Added Init state. Recreate exit and advertise channels when recovering
In order to differentiate between intialized and other states we introduced a new state: Init. The router is in this state only when it's created. We have cleaned up router status management which is now handled by manageStatus function only.
This commit is contained in:
		| @@ -56,8 +56,10 @@ type Status struct { | ||||
| } | ||||
|  | ||||
| const ( | ||||
| 	// Running means the rotuer is running | ||||
| 	Running StatusCode = iota | ||||
| 	// Init means the rotuer has just been initialized | ||||
| 	Init StatusCode = iota | ||||
| 	// Running means the router is running | ||||
| 	Running | ||||
| 	// Error means the router has crashed with error | ||||
| 	Error | ||||
| 	// Stopped means the router has stopped | ||||
| @@ -67,6 +69,8 @@ const ( | ||||
| // String returns human readable status code | ||||
| func (sc StatusCode) String() string { | ||||
| 	switch sc { | ||||
| 	case Init: | ||||
| 		return "INITIALIZED" | ||||
| 	case Running: | ||||
| 		return "RUNNING" | ||||
| 	case Error: | ||||
|   | ||||
		Reference in New Issue
	
	Block a user