diff --git a/manager.go b/manager.go index a3af4ebaed6de33537c20c307da731dc47ec4995..dad53ee93264564d7a5a2bf0f448c64fce6dd16a 100644 --- a/manager.go +++ b/manager.go @@ -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()