Skip to content
Snippets Groups Projects
Commit 71f68323 authored by Jonas Leder's avatar Jonas Leder
Browse files

run message worker for local queue

parent 244e9e5c
Branches
No related tags found
1 merge request!3Implement API server for DB inserts
Pipeline #54595 passed
...@@ -37,6 +37,7 @@ func main() { ...@@ -37,6 +37,7 @@ func main() {
} }
if os.Getenv("LOGGER_SERVER") == "true" { if os.Getenv("LOGGER_SERVER") == "true" {
server.Init() server.Init()
go messageworker.RunServer()
server.Run() server.Run()
} else { } else {
log.Log.Fatal("Either LOGGER_CLIENT or LOGGER_SERVER has to be enabled in config") log.Log.Fatal("Either LOGGER_CLIENT or LOGGER_SERVER has to be enabled in config")
... ...
......
...@@ -17,11 +17,15 @@ func RunClient() { ...@@ -17,11 +17,15 @@ func RunClient() {
if os.Getenv("CLIENT_USE_SERVER") != "true" { if os.Getenv("CLIENT_USE_SERVER") != "true" {
log.Log.Info("Intialized local client with direct datbase connection") log.Log.Info("Intialized local client with direct datbase connection")
runLocalDbClient() runDbClient()
} }
} }
func runLocalDbClient() { func RunServer() {
runDbClient()
}
func runDbClient() {
for { for {
taskData, taskId, err := queue.MainQueue.Dequeue() taskData, taskId, err := queue.MainQueue.Dequeue()
if err != nil { if err != nil {
... ...
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment