public void Timer_Elapsed(object sender, ElapsedEventArgs e) { if (_cancellationToken.IsCancellationRequested) _timer.Enabled = false; // Flushing to disk _storage.FlushOnDisk(); }