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
|
|
@ -13,7 +13,7 @@ import (
|
|||
|
||||
func declareAlarmsRoutes(cfg *config.Config, db *reveil.LevelDBStorage, resetTimer func(), router *gin.RouterGroup) {
|
||||
router.GET("/alarms/next", func(c *gin.Context) {
|
||||
alarm, err := reveil.GetNextAlarm(db)
|
||||
alarm, err := reveil.GetNextAlarm(cfg, db)
|
||||
if err != nil {
|
||||
c.AbortWithStatusJSON(http.StatusInternalServerError, gin.H{"errmsg": err.Error()})
|
||||
return
|
||||
|
|
@ -200,8 +200,8 @@ func declareAlarmsRoutes(cfg *config.Config, db *reveil.LevelDBStorage, resetTim
|
|||
|
||||
repeatedAlarmsRoutes.GET("", func(c *gin.Context) {
|
||||
alarm := c.MustGet("alarm").(*reveil.AlarmRepeated)
|
||||
alarm.FillExcepts(db)
|
||||
alarm.NextTime = alarm.GetNextOccurence(db)
|
||||
alarm.FillExcepts(cfg, db)
|
||||
alarm.NextTime = alarm.GetNextOccurence(cfg, db)
|
||||
|
||||
c.JSON(http.StatusOK, alarm)
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue