bit more logging, reset on timer reset
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
5ad3582a85
commit
2059932ad9
1
main.go
1
main.go
@ -51,7 +51,6 @@ func main() {
|
|||||||
}
|
}
|
||||||
var nun *nunWatch
|
var nun *nunWatch
|
||||||
uid := id.NewUserID(strings.ToLower(conf.Username), strings.ToLower(conf.Domain))
|
uid := id.NewUserID(strings.ToLower(conf.Username), strings.ToLower(conf.Domain))
|
||||||
log.Println(uid)
|
|
||||||
store.SaveFilterID(uid, fID.FilterID)
|
store.SaveFilterID(uid, fID.FilterID)
|
||||||
matrixClient.Store = store
|
matrixClient.Store = store
|
||||||
syncer := matrixClient.Syncer.(*mautrix.DefaultSyncer)
|
syncer := matrixClient.Syncer.(*mautrix.DefaultSyncer)
|
||||||
|
2
nun.go
2
nun.go
@ -22,6 +22,7 @@ func newNunWatch(stop chan bool, c *mautrix.Client, t int) *nunWatch {
|
|||||||
|
|
||||||
func (n *nunWatch) SetTimer(t int) {
|
func (n *nunWatch) SetTimer(t int) {
|
||||||
n.timer = t
|
n.timer = t
|
||||||
|
n.fail = 0
|
||||||
}
|
}
|
||||||
|
|
||||||
func (n *nunWatch) Main() {
|
func (n *nunWatch) Main() {
|
||||||
@ -53,6 +54,7 @@ func (n *nunWatch) Main() {
|
|||||||
ticker.Reset(60 * time.Second)
|
ticker.Reset(60 * time.Second)
|
||||||
}
|
}
|
||||||
if curT != n.timer {
|
if curT != n.timer {
|
||||||
|
log.Println("updating nunwatch timer")
|
||||||
ticker.Reset(time.Duration(n.timer) * time.Minute)
|
ticker.Reset(time.Duration(n.timer) * time.Minute)
|
||||||
curT = n.timer
|
curT = n.timer
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user