This commit is contained in:
2023-05-18 16:53:19 +08:00
parent b342ed0dbc
commit da855c1b29
5 changed files with 2 additions and 27 deletions
BIN
View File
Binary file not shown.
+2 -2
View File
@@ -13,7 +13,7 @@ import (
type Remind struct {
db *stardb.StarDB
tasks map[int]Task
mu sync.RWMutex
mu *sync.RWMutex
callback func(remind Task)
}
@@ -52,7 +52,7 @@ func NewRemind(db *stardb.StarDB, callback func(task Task)) (*Remind, error) {
func innerLoadDB(db *stardb.StarDB, callback func(task Task)) (*Remind, error) {
var rem = Remind{
db: db,
mu: sync.RWMutex{},
mu: new(sync.RWMutex),
callback: callback,
tasks: make(map[int]Task),
}