private async Task CheckStopRequestAsync() { bool shouldStop = await _keyValueStore.ExistsAsync("stop_indexing"); if (_stopped && !shouldStop) { _orchestrator.Start(); _stopped = false; } if (!_stopped && shouldStop) { _orchestrator.Stop(); _stopped = true; } }
private async Task <bool> ShouldScheduleAsync() { return(!await _keyValueStore.ExistsAsync("stop_scheduling")); }