Skip to content
This repository has been archived by the owner on Oct 23, 2020. It is now read-only.

Commit

Permalink
fix issues with race detector
Browse files Browse the repository at this point in the history
  • Loading branch information
sairam committed Apr 14, 2017
1 parent 5aa9e9a commit 108f18d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions gitnotify/cron.go
Expand Up @@ -23,14 +23,18 @@ var (
)

func isCronPresentFor(filename string) bool {
cronLocker.Lock()
id := runningCrons[filename]
cronLocker.Unlock()
entry := crons.Entry(id)
return entry.Valid()
}

func checkCronEntries(filename string) (nextRunTimes []string) {
nextRunTimes = make([]string, 0, 15)
cronLocker.Lock()
id := runningCrons[filename]
cronLocker.Unlock()
entry := crons.Entry(id)
if !entry.Valid() {
return
Expand Down Expand Up @@ -84,6 +88,7 @@ func upsertCronEntry(s *Setting) {
toStart := true

id := runningCrons[filename]

if id != 0 {
// check if entry was not modified
var entry cron.Entry
Expand Down

0 comments on commit 108f18d

Please sign in to comment.