Browse Source
[service] check for error returned by impl
otherwise, we mark it as started when it is not in fact
pull/1842/head
Anton Kaliaev
8 years ago
No known key found for this signature in database
GPG Key ID: 7B6881D965918214
1 changed files with
5 additions and
0 deletions
-
service.go
|
@ -94,6 +94,11 @@ func (bs *BaseService) Start() (bool, error) { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
err := bs.impl.OnStart() |
|
|
err := bs.impl.OnStart() |
|
|
|
|
|
if err != nil { |
|
|
|
|
|
// revert flag
|
|
|
|
|
|
atomic.StoreUint32(&bs.started, 0) |
|
|
|
|
|
return false, err |
|
|
|
|
|
} |
|
|
return true, err |
|
|
return true, err |
|
|
} else { |
|
|
} else { |
|
|
if bs.log != nil { |
|
|
if bs.log != nil { |
|
|