From 273b43f5e0c4f102405a29a2fea60f0f30f8f865 Mon Sep 17 00:00:00 2001 From: Zeni Kim Date: Mon, 23 Dec 2024 23:40:22 -0500 Subject: [PATCH] add config option to disable queues --- config/queue.go | 20 ++++++++++++++++++++ main.go | 4 +++- 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 config/queue.go diff --git a/config/queue.go b/config/queue.go new file mode 100644 index 0000000..8060572 --- /dev/null +++ b/config/queue.go @@ -0,0 +1,20 @@ +// Copyright (c) 2025 Zeni Kim +// 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, + } +} diff --git a/main.go b/main.go index 8e7c815..5fac06e 100644 --- a/main.go +++ b/main.go @@ -62,7 +62,9 @@ func main() { registerGlobalHooks() registerRoutes() registerEvents() - registerQueues() + if config.GetQueueConfig().EnableQueue == true { + registerQueues() + } if config.GetGormConfig().EnableGorm == true { RunAutoMigrations() }