Skip to content

Commit 662ddf0

Browse files
authored
Merge pull request #232 from jum/firestore_cleanup_fix
Implement the race condition fix as described in #231.
2 parents b6793b4 + 21069e6 commit 662ddf0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

firestore/firestore.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ func NewWithCleanupInterval(client *firestore.Client, cleanupInterval time.Durat
4040
}
4141

4242
if cleanupInterval > 0 {
43+
m.stopCleanup = make(chan bool)
4344
go m.startCleanup(cleanupInterval)
4445
}
4546

@@ -112,7 +113,6 @@ func (m *FireStore) AllCtx(ctx context.Context) (map[string][]byte, error) {
112113
}
113114

114115
func (m *FireStore) startCleanup(interval time.Duration) {
115-
m.stopCleanup = make(chan bool)
116116
ticker := time.NewTicker(interval)
117117
for {
118118
select {

0 commit comments

Comments
 (0)