MCPcopy Create free account
hub / github.com/PasarGuard/node / Restart

Method Restart

backend/xray/core.go:340–361  ·  view source on GitHub ↗
(config *Config, debugMode bool)

Source from the content-addressed store, hash-verified

338}
339
340func (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
363func (c *Core) Restarting() bool {
364 c.mu.Lock()

Callers

nothing calls this directly

Calls 2

StopMethod · 0.95
StartMethod · 0.95

Tested by

no test coverage detected