// Token: 0x060003E9 RID: 1001 RVA: 0x00012A0C File Offset: 0x00010C0C
        internal void UpdateWorkCycle(TimeSpan workCyclePeriod)
        {
            bool flag  = false;
            bool flag2 = false;

            lock (this.instanceLock)
            {
                if (this.assistantWorkloadState == TimeBasedDatabaseDriver.AssistantWorkloadStateOnDatabase.Enabled || this.assistantWorkloadState == TimeBasedDatabaseDriver.AssistantWorkloadStateOnDatabase.EnabledAndRunning)
                {
                    flag = true;
                    if (this.assistantWorkloadState == TimeBasedDatabaseDriver.AssistantWorkloadStateOnDatabase.Enabled)
                    {
                        this.windowJobHistory.Clear();
                        this.startTime = DateTime.UtcNow;
                        this.assistantWorkloadState = TimeBasedDatabaseDriver.AssistantWorkloadStateOnDatabase.EnabledAndRunning;
                    }
                    if (!this.inWorkCycle)
                    {
                        ExTraceGlobals.TimeBasedDatabaseDriverTracer.TraceDebug <TimeBasedDatabaseDriver, bool, bool>((long)this.GetHashCode(), "{0}: Start Work Cycle. Started: {1}, Job Running: {2}.", this, this.started, this.WindowJobRunning);
                        if (!this.started)
                        {
                            AssistantsLog.LogDriverNotStartedEvent(this.Assistant.NonLocalizedName, this.Assistant as AssistantBase);
                        }
                        else if (this.WindowJobRunning)
                        {
                            AssistantsLog.LogJobAlreadyRunningEvent(this.Assistant.NonLocalizedName);
                        }
                        else
                        {
                            flag2 = true;
                        }
                    }
                }
                else if (this.assistantWorkloadState == TimeBasedDatabaseDriver.AssistantWorkloadStateOnDatabase.Disabled)
                {
                    this.windowJobHistory.Clear();
                    this.startTime = DateTime.UtcNow;
                    this.assistantWorkloadState = TimeBasedDatabaseDriver.AssistantWorkloadStateOnDatabase.DisabledAndNotRunning;
                }
            }
            if (flag && !this.inWorkCycle)
            {
                if (flag2)
                {
                    this.assistantType.OnWorkCycleStart(this.DatabaseInfo);
                    this.TryStartWorkCycle(workCyclePeriod);
                }
                this.inWorkCycle = true;
            }
        }