mirror of
				https://github.com/caddyserver/caddy.git
				synced 2025-10-31 02:27:19 -04:00 
			
		
		
		
	core: instance restart (reload) event (#2178)
This commit is contained in:
		
							parent
							
								
									e54dfa49c3
								
							
						
					
					
						commit
						6965075825
					
				| @ -263,9 +263,10 @@ type EventName string | ||||
| // Define names for the various events | ||||
| const ( | ||||
| 	StartupEvent         EventName = "startup" | ||||
| 	ShutdownEvent        EventName = "shutdown" | ||||
| 	CertRenewEvent       EventName = "certrenew" | ||||
| 	InstanceStartupEvent EventName = "instancestartup" | ||||
| 	ShutdownEvent                  = "shutdown" | ||||
| 	CertRenewEvent                 = "certrenew" | ||||
| 	InstanceStartupEvent           = "instancestartup" | ||||
| 	InstanceRestartEvent           = "instancerestart" | ||||
| ) | ||||
| 
 | ||||
| // EventHook is a type which holds information about a startup hook plugin. | ||||
|  | ||||
| @ -90,6 +90,7 @@ func trapSignalsPosix() { | ||||
| 				purgeEventHooks() | ||||
| 
 | ||||
| 				// Kick off the restart; our work is done | ||||
| 				EmitEvent(InstanceRestartEvent, nil) | ||||
| 				_, err = inst.Restart(caddyfileToUse) | ||||
| 				if err != nil { | ||||
| 					restoreEventHooks(oldEventHooks) | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user