diff options
Diffstat (limited to 'web/web.go')
| -rw-r--r-- | web/web.go | 26 |
1 files changed, 15 insertions, 11 deletions
@@ -266,6 +266,11 @@ func (s *Server) initRouter() (*gin.Engine, error) { s.panel = controller.NewXUIController(g) s.api = controller.NewAPIController(g) + // Chrome DevTools endpoint for debugging web apps + engine.GET("/.well-known/appspecific/com.chrome.devtools.json", func(c *gin.Context) { + c.JSON(http.StatusOK, gin.H{}) + }) + // Add a catch-all route to handle undefined paths and return 404 engine.NoRoute(func(c *gin.Context) { c.AbortWithStatus(http.StatusNotFound) @@ -314,17 +319,16 @@ func (s *Server) startTask() { // Run once a month, midnight, first of month s.cron.AddJob("@monthly", job.NewPeriodicTrafficResetJob("monthly")) - // LDAP sync scheduling - if ldapEnabled, _ := s.settingService.GetLdapEnable(); ldapEnabled { - runtime, err := s.settingService.GetLdapSyncCron() - if err != nil || runtime == "" { - runtime = "@every 1m" - } - j := job.NewLdapSyncJob() - // job has zero-value services with method receivers that read settings on demand - s.cron.AddJob(runtime, j) - } - + // LDAP sync scheduling + if ldapEnabled, _ := s.settingService.GetLdapEnable(); ldapEnabled { + runtime, err := s.settingService.GetLdapSyncCron() + if err != nil || runtime == "" { + runtime = "@every 1m" + } + j := job.NewLdapSyncJob() + // job has zero-value services with method receivers that read settings on demand + s.cron.AddJob(runtime, j) + } // Make a traffic condition every day, 8:30 var entry cron.EntryID |
