Skip to content
Snippets Groups Projects
Verified Commit 92f48c4c authored by Volker Schukai's avatar Volker Schukai :alien:
Browse files

feat: new manager function for get jobs and check job is active #10

parent 735375b2
No related branches found
No related tags found
No related merge requests found
......@@ -100,6 +100,21 @@ func (m *Manager) NewEventScheduler(event EventName) *EventScheduler {
}
}
// GetActiveJobs returns the active jobs
func (m *Manager) GetActiveJobs() map[JobID]GenericJob {
m.mu.Lock()
defer m.mu.Unlock()
return m.activeJobs
}
// ContainsActiveJob checks if a job is active
func (m *Manager) ContainsActiveJob(id JobID) bool {
m.mu.Lock()
defer m.mu.Unlock()
_, ok := m.activeJobs[id]
return ok
}
func (m *Manager) SetDB(db *gorm.DB) *Manager {
m.mu.Lock()
defer m.mu.Unlock()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment