tracebundy
660bd4a53e
fix comment ( #3454 )
6 years ago
Anton Kaliaev
e3e3c13741
[common] revert started flag when service already stopped ( #2326 )
also, return ErrNotStarted when trying to stop a not-running service
6 years ago
Dev Ojha
2756be5a59
libs: Remove usage of custom Fmt, in favor of fmt.Sprintf ( #2199 )
* libs: Remove usage of custom Fmt, in favor of fmt.Sprintf
Closes #2193
* Fix bug that was masked by custom Fmt!
6 years ago
Zach Ramsay
44dad6d70b
Revert "detele everything"
This reverts commit d02c5d1e30
.
6 years ago
Zach Ramsay
d02c5d1e30
detele everything
6 years ago
Ethan Buchman
d55243f0e6
fix import paths
6 years ago
Ethan Buchman
ae3bf81833
mv tmlibs files to libs dir
6 years ago
Thomas Corbière
ee67e34519
Fix lint errors ( #190 )
* use increment and decrement operators.
* remove unnecessary else branches.
* fix receiver names.
* remove omittable code.
* fix dot imports.
7 years ago
Anton Kaliaev
a57340ffb5
add Quit method to Service interface
remove deprecated QuitService
7 years ago
Ethan Buchman
4d991acae0
common: comments for Service
7 years ago
Anton Kaliaev
c2fcc093b2
remove bool from Service#Reset
7 years ago
Anton Kaliaev
e6164d4052
change service#Stop to be similar to Start
7 years ago
Anton Kaliaev
4123d54bf6
change service#Start to return just error (Refs #45 )
```
@melekes
yeah, bool is superfluous
@ethanfrey
If I remember correctly when I was writing test code, if I call Start() on a Service that is already running, it returns (false, nil). Only if I try to legitimately start it, but it fails in startup do I get an error.
The distinction is quite important to make it safe for reentrant calls. The other approach would be to have a special error type like ErrAlreadyStarted, then check for that in your code explicitly. Kind of like if I make a db call in gorm, and get an error, I check if it is a RecordNotFound error, or whether there was a real error with the db query.
@melekes
Ah, I see. Thanks. I must say I like ErrAlreadyStarted approach more (not just in Golang)
```
7 years ago
Ethan Buchman
c8805fd7de
metalinter fixes from review
7 years ago
Zach Ramsay
cf49ba876f
linter: couple fixes
7 years ago
Zach Ramsay
3c57c24921
linting: next round of fixes
7 years ago
Anton Kaliaev
ed76afd409
Logger interface and tmLogger impl based on go-kit
8 years ago
Ethan Buchman
356657a37b
move all files to common/ to begin repo merge
8 years ago
Anton Kaliaev
dec518eb06
update comment [ci skip] [circleci skip]
8 years ago
Anton Kaliaev
7a12594edb
[service] recreate Quit channel on reset
don't think that user should do this thing him/herself
8 years ago
Anton Kaliaev
c46ffe39a8
[service] check for error returned by impl
otherwise, we mark it as started when it is not in fact
8 years ago
Ethan Buchman
a552e49b50
Reverts commit f40b1b to a6a67e
8 years ago
Jae Kwon
890e240730
Remove AutoFile tests
8 years ago
Jae Kwon
25dc9ae345
QuitService->BaseService
8 years ago
Jae Kwon
fa3daa7abc
Remove AutoFile tests
8 years ago
Jae Kwon
2781df39e5
QuitService->BaseService
8 years ago
Ethan Buchman
2e424ee663
service: Reset() for restarts
8 years ago
Ethan Buchman
9364accf1f
service: start/stop logs are info, ignored are debug
9 years ago
Ethan Buchman
02022e356a
make ignore already stopped service Debug
9 years ago
Jae Kwon
19f5a93cff
Adjust Service log notice for duplicate stops
9 years ago
Jae Kwon
6b54e7b8d9
Added License
9 years ago
Jae Kwon
16372365c4
First commit
9 years ago