mirror of
https://codeberg.org/cunicu/cunicu.git
synced 2025-09-27 05:06:02 +08:00
@@ -89,7 +89,7 @@ func NewDaemon(cfg *config.Config) (*Daemon, error) {
|
|||||||
return d, nil
|
return d, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Start starts the daemon and blocks until Stop() is called.
|
// Start starts the daemon and blocks until Shutdown() is called.
|
||||||
func (d *Daemon) Start() error {
|
func (d *Daemon) Start() error {
|
||||||
if err := d.setState(StateInitializing); err != nil {
|
if err := d.setState(StateInitializing); err != nil {
|
||||||
return fmt.Errorf("failed transition state: %w", err)
|
return fmt.Errorf("failed transition state: %w", err)
|
||||||
@@ -154,7 +154,7 @@ out:
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Stop stops the daemon
|
// Shutdown stops the daemon.
|
||||||
func (d *Daemon) Shutdown(restart bool) {
|
func (d *Daemon) Shutdown(restart bool) {
|
||||||
if d.stop == nil {
|
if d.stop == nil {
|
||||||
return
|
return
|
||||||
|
Reference in New Issue
Block a user