Skip to content

Commit

Permalink
address comments (uber#3248)
Browse files Browse the repository at this point in the history
  • Loading branch information
yux0 authored May 8, 2020
1 parent 4e025cf commit df82425
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion common/persistence/domainReplicationQueue.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func (q *domainReplicationQueueImpl) Start() {
}

func (q *domainReplicationQueueImpl) Stop() {
if !atomic.CompareAndSwapInt32(&q.status, common.DaemonStatusInitialized, common.DaemonStatusStopped) {
if !atomic.CompareAndSwapInt32(&q.status, common.DaemonStatusStarted, common.DaemonStatusStopped) {
return
}
close(q.done)
Expand Down
2 changes: 2 additions & 0 deletions service/frontend/adminHandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,14 @@ func (adh *AdminHandler) RegisterHandler() {
func (adh *AdminHandler) Start() {
// Start domain replication queue cleanup
if adh.config.EnableCleanupReplicationTask() {
// If the queue does not start, we can still call stop()
adh.Resource.GetDomainReplicationQueue().Start()
}
}

// Stop stops the handler
func (adh *AdminHandler) Stop() {
// Calling stop if the queue does not start is ok
adh.Resource.GetDomainReplicationQueue().Stop()
}

Expand Down

0 comments on commit df82425

Please sign in to comment.