Browse Source

En cours de développement

master
losyme 2 months ago
parent
commit
6cf7179641
  1. 7
      internal/application/events.go
  2. 15
      internal/storage/memory/purge.go
  3. 15
      internal/storage/mongo/purge.go
  4. 1
      internal/storage/storage.go

7
internal/application/events.go

@ -12,6 +12,13 @@ func (app *Application) onMessage(msg *scheduler.Message) {
cs := app.cs
cs.Logger().Info("Event", "name", msg.Event) //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
switch msg.Event {
case "storage.purge":
if err := cs.Storage().Purge(); err != nil {
cs.Logger().Error("Cannot delete old jobs/workflows", nil, err) //::::::::::::::::::::::::::::::::::::::::::
}
}
}
/*

15
internal/storage/memory/purge.go

@ -0,0 +1,15 @@
/*
------------------------------------------------------------------------------------------------------------------------
####### dune ####### Copyright (c) 2021-2022 losyme ################################################ MIT License #######
------------------------------------------------------------------------------------------------------------------------
*/
package memory
func (ms *memoryStorage) Purge() error {
return nil
}
/*
######################################################################################################## @(°_°)@ #######
*/

15
internal/storage/mongo/purge.go

@ -0,0 +1,15 @@
/*
------------------------------------------------------------------------------------------------------------------------
####### dune ####### Copyright (c) 2021-2022 losyme ################################################ MIT License #######
------------------------------------------------------------------------------------------------------------------------
*/
package mongo
func (ms *mongoStorage) Purge() error {
return nil
}
/*
######################################################################################################## @(°_°)@ #######
*/

1
internal/storage/storage.go

@ -56,6 +56,7 @@ type Storage interface {
UpdateWorkflow(wf *jw.Workflow, job, nextJob *jw.Job) error
SetWorkflowPriority(id string, priority jw.Priority) error
Purge() error
State() (*State, error)
Close() error
}

Loading…
Cancel
Save