Don't rely exclusively on /etc/timezone
This commit is contained in:
parent
141a60c1d1
commit
1df1ba8996
6 changed files with 47 additions and 11 deletions
3
app.go
3
app.go
|
|
@ -64,6 +64,7 @@ func (app *App) Start() {
|
|||
Handler: app.router,
|
||||
}
|
||||
|
||||
log.Println("Current timezone:", app.cfg.Timezone.String())
|
||||
app.ResetTimer()
|
||||
|
||||
log.Printf("Ready, listening on %s\n", app.cfg.Bind)
|
||||
|
|
@ -78,7 +79,7 @@ func (app *App) ResetTimer() {
|
|||
app.nextAlarm = nil
|
||||
}
|
||||
|
||||
if na, err := reveil.GetNextAlarm(app.db); err == nil && na != nil {
|
||||
if na, err := reveil.GetNextAlarm(app.cfg, app.db); err == nil && na != nil {
|
||||
app.nextAlarm = time.AfterFunc(time.Until(*na), func() {
|
||||
app.nextAlarm = nil
|
||||
reveil.RemoveOldAlarmsSingle(app.db)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue