aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorAnhgelus Morhtuuzh <anhgelus@anhgelus.world>2025-03-10 21:53:59 +0100
committerAnhgelus Morhtuuzh <anhgelus@anhgelus.world>2025-03-10 21:53:59 +0100
commitd0253f36b4b4b98f936efeb973f588affb35c935 (patch)
tree44516e3a2059970be5a67cdf247ad54360f4bac0 /main.go
parent48c9f5ae80b9ec765a9bf5f1096d7158bcfa74ef (diff)
feat(copaing): restore data if copaing rejoins after max 48 hours
Diffstat (limited to 'main.go')
-rw-r--r--main.go14
1 files changed, 10 insertions, 4 deletions
diff --git a/main.go b/main.go
index b019b7c..5bbc289 100644
--- a/main.go
+++ b/main.go
@@ -18,9 +18,11 @@ var (
updatesData []byte
Version = gokord.Version{
Major: 2,
- Minor: 3,
- Patch: 5,
- } // git version: 0.3.5 (it's the v2 of the bot)
+ Minor: 4,
+ Patch: 0,
+ } // git version: 0.4.0 (it's the v2 of the bot)
+
+ stopPeriodicReducer chan<- interface{}
)
func init() {
@@ -170,6 +172,10 @@ func main() {
}
bot.Start()
+ if stopPeriodicReducer != nil {
+ stopPeriodicReducer <- true
+ }
+
xp.CloseRedisClient()
}
@@ -185,7 +191,7 @@ func afterInit(dg *discordgo.Session) {
// reduce time for debug
d = time.Minute
}
- utils.NewTimer(d, func(stop chan<- interface{}) {
+ stopPeriodicReducer = utils.NewTimer(d, func(stop chan<- interface{}) {
xp.PeriodicReducer(dg)
})
}