Method
Restart
(config *Config, debugMode bool)
Source from the content-addressed store, hash-verified
| 338 | } |
| 339 | |
| 340 | func (c *Core) Restart(config *Config, debugMode bool) error { |
| 341 | c.mu.Lock() |
| 342 | if c.restarting { |
| 343 | c.mu.Unlock() |
| 344 | return errors.New("xray is already restarting") |
| 345 | } |
| 346 | c.restarting = true |
| 347 | c.mu.Unlock() |
| 348 | |
| 349 | defer func() { |
| 350 | c.mu.Lock() |
| 351 | c.restarting = false |
| 352 | c.mu.Unlock() |
| 353 | }() |
| 354 | |
| 355 | log.Println("restarting Xray core...") |
| 356 | c.Stop() |
| 357 | if err := c.Start(config, debugMode); err != nil { |
| 358 | return err |
| 359 | } |
| 360 | return nil |
| 361 | } |
| 362 | |
| 363 | func (c *Core) Restarting() bool { |
| 364 | c.mu.Lock() |
Callers
nothing calls this directly
Tested by
no test coverage detected