GSF.TimeSeries.Transport.DataGapRecoverer.FlushLog C# (CSharp) Method

FlushLog() public method

Blocks calling thread until data gap OutageLog has been flushed to disk.

Data gap log is automatically persisted to disk as Outage items are added or removed from the log. This function only exists to force a flush and block calling thread until flush has completed.

Function first waits for any pending data gap operation to complete then waits for data gap log to be flushed. Both waits use the same timeout value, as a result it is possible that total wait time could be longer than specified wait time.

public FlushLog ( int timeout = Timeout.Infinite ) : bool
timeout int Optional time-out for waiting thread block. Defaults to waiting indefinitely.
return bool
        public bool FlushLog(int timeout = Timeout.Infinite)
        {
            if (m_disposed)
                throw new InvalidOperationException("Data gap recoverer has been disposed. Cannot flush log.");

            if ((object)m_dataGapLog == null)
                throw new InvalidOperationException("Data gap recoverer has not been initialized. Cannot flush log.");

            // Wait for process completion if in progress
            if (m_dataGapRecoveryCompleted.Wait(timeout))
                return m_dataGapLog.Flush().Wait(timeout);

            return false;
        }