コード例 #1
0
ファイル: main.go プロジェクト: pselibas/semaphore
func checkUpdates() {
	util.CheckUpdate(util.Version)

	t := time.NewTicker(time.Hour * 24)

	for range t.C {
		util.CheckUpdate(util.Version)
	}
}
コード例 #2
0
ファイル: router.go プロジェクト: pselibas/semaphore
func checkUpgrade(c *gin.Context) {
	if err := util.CheckUpdate(util.Version); err != nil {
		c.JSON(500, err)
		return
	}

	if util.UpdateAvailable != nil {
		getSystemInfo(c)
		return
	}

	c.AbortWithStatus(204)
}