From bad95987ec697e5945755adc7216b5017f85090a Mon Sep 17 00:00:00 2001 From: Chaim Lev-Ari Date: Mon, 1 Oct 2018 04:38:14 +0300 Subject: [PATCH] feat(backend): trigger startup snapshot job in a goroutine (#2309) * feat(backend): wrap init enpoint with goroutine * feat(backend): wrap job snapshot with goroutine * feat(snapshots): reset changes for main and job_endpoint * feat(snapshot): run first job.snapshot as a goroutine --- api/cron/scheduler.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/api/cron/scheduler.go b/api/cron/scheduler.go index 9f65b6d5a..42abee371 100644 --- a/api/cron/scheduler.go +++ b/api/cron/scheduler.go @@ -45,11 +45,7 @@ func (scheduler *JobScheduler) ScheduleEndpointSyncJob(endpointFilePath string, // ScheduleSnapshotJob schedules a cron job to create endpoint snapshots func (scheduler *JobScheduler) ScheduleSnapshotJob(interval string) error { job := newEndpointSnapshotJob(scheduler.endpointService, scheduler.snapshotter) - - err := job.Snapshot() - if err != nil { - return err - } + go job.Snapshot() return scheduler.cron.AddJob("@every "+interval, job) }