mirror of
https://github.com/jhillyerd/inbucket.git
synced 2025-12-18 10:07:02 +00:00
RetentionJoin() could block if scanner never started
This commit is contained in:
@@ -2,7 +2,11 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
This project adheres to [Semantic Versioning](http://semver.org/).
|
||||
|
||||
## [1.1.0-rc1]
|
||||
## [Unreleased]
|
||||
### Fixed
|
||||
- Shutdown hang in retention scanner
|
||||
|
||||
## [1.1.0-rc1] - 2016-03-04
|
||||
### Added
|
||||
- Inbucket now builds with Go 1.5 or 1.6
|
||||
- Project can build & run inside a Docker container
|
||||
|
||||
@@ -133,8 +133,10 @@ func doRetentionScan(ds DataStore, maxAge time.Duration, sleep time.Duration) er
|
||||
|
||||
// RetentionJoin does not retun until the retention scanner has shut down
|
||||
func RetentionJoin() {
|
||||
select {
|
||||
case _ = <-retentionShutdown:
|
||||
if retentionShutdown != nil {
|
||||
select {
|
||||
case _ = <-retentionShutdown:
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user