add config option to disable queues

This commit is contained in:
Zeni Kim 2024-12-23 23:40:22 -05:00
parent d413d7def4
commit 273b43f5e0
2 changed files with 23 additions and 1 deletions

20
config/queue.go Normal file
View file

@ -0,0 +1,20 @@
// Copyright (c) 2025 Zeni Kim <zenik@smarteching.com>
// Use of this source code is governed by MIT-style
// license that can be found in the LICENSE file.
package config
import "git.smarteching.com/goffee/core"
// Retrieve the main config for the Queue
func GetQueueConfig() core.QueueConfig {
//#####################################
//# Main configuration for Queue #####
//#####################################
return core.QueueConfig{
// For enabling and disabling the queue system
// set to true to enable it, set to false to disable
EnableQueue: false,
}
}

View file

@ -62,7 +62,9 @@ func main() {
registerGlobalHooks() registerGlobalHooks()
registerRoutes() registerRoutes()
registerEvents() registerEvents()
if config.GetQueueConfig().EnableQueue == true {
registerQueues() registerQueues()
}
if config.GetGormConfig().EnableGorm == true { if config.GetGormConfig().EnableGorm == true {
RunAutoMigrations() RunAutoMigrations()
} }