mirror of
https://github.com/sablierapp/sablier.git
synced 2025-12-25 14:59:16 +01:00
Make channel write non blocking
This commit is contained in:
9
main.go
9
main.go
@@ -101,10 +101,17 @@ func (service *Service) HandleServiceState(cli *client.Client) (string, error) {
|
||||
}
|
||||
if status == UP {
|
||||
fmt.Printf("- Service %v is up\n", service.name)
|
||||
fmt.Printf("up %+v\n", time.Now())
|
||||
if !service.isHandled {
|
||||
fmt.Printf("not handled %+v\n", time.Now())
|
||||
go service.stopAfterTimeout(cli)
|
||||
}
|
||||
service.time <- service.timeout
|
||||
fmt.Printf("before write %+v\n", time.Now())
|
||||
select {
|
||||
case service.time <- service.timeout:
|
||||
fmt.Printf("after write %+v\n", time.Now())
|
||||
default:
|
||||
}
|
||||
return "started", nil
|
||||
} else if status == STARTING {
|
||||
fmt.Printf("- Service %v is starting\n", service.name)
|
||||
|
||||
Reference in New Issue
Block a user