public async Task StartWatchingImageRepository(Application application) { _log.LogInformation("Adding application {name}, beginning watch of repositories", application.Name); for (var i = 0; i < application.Images.Count; i++) { var image = application.Images[i]; var key = new RegistryWatcherKey(application, image); var jobContext = new RegistryWatcherJobContext(application, image, i); if (_jobs.TryAdd(key, jobContext)) { await _scheduler.ScheduleJob(jobContext.Job, jobContext.Trigger); } } }
protected bool Equals(RegistryWatcherKey other) { return(_application.Equals(other._application) && _image.Equals(other._image)); }