diff --git a/src/NzbDrone.Core/Applications/ApplicationIndexerSyncCommand.cs b/src/NzbDrone.Core/Applications/ApplicationIndexerSyncCommand.cs index 50318ecbd..769843dd3 100644 --- a/src/NzbDrone.Core/Applications/ApplicationIndexerSyncCommand.cs +++ b/src/NzbDrone.Core/Applications/ApplicationIndexerSyncCommand.cs @@ -13,6 +13,6 @@ namespace NzbDrone.Core.Applications public override bool SendUpdatesToClient => true; - public override string CompletionMessage => null; + public override string CompletionMessage => "Completed"; } } diff --git a/src/NzbDrone.Core/IndexerSearch/ReleaseSearchService.cs b/src/NzbDrone.Core/IndexerSearch/ReleaseSearchService.cs index 03f546c42..e39a2d092 100644 --- a/src/NzbDrone.Core/IndexerSearch/ReleaseSearchService.cs +++ b/src/NzbDrone.Core/IndexerSearch/ReleaseSearchService.cs @@ -196,7 +196,7 @@ namespace NzbDrone.Core.IndexerSearch var reports = batch.SelectMany(x => x).ToList(); - _logger.Debug("Total of {0} reports were found for {1} from {2} indexer(s)", reports.Count, criteriaBase, indexers.Count); + _logger.ProgressDebug("Total of {0} reports were found for {1} from {2} indexer(s)", reports.Count, criteriaBase, indexers.Count); return reports; } diff --git a/src/NzbDrone.Core/Messaging/Commands/Command.cs b/src/NzbDrone.Core/Messaging/Commands/Command.cs index 020b5ec64..224173437 100644 --- a/src/NzbDrone.Core/Messaging/Commands/Command.cs +++ b/src/NzbDrone.Core/Messaging/Commands/Command.cs @@ -23,7 +23,7 @@ namespace NzbDrone.Core.Messaging.Commands } public virtual bool UpdateScheduledTask => true; - public virtual string CompletionMessage => "Completed"; + public virtual string CompletionMessage => null; public virtual bool RequiresDiskAccess => false; public virtual bool IsExclusive => false; public virtual bool IsTypeExclusive => false; diff --git a/src/NzbDrone.Core/ProgressMessaging/ProgressMessageContext.cs b/src/NzbDrone.Core/ProgressMessaging/ProgressMessageContext.cs index fba9ca3f3..09fecee2c 100644 --- a/src/NzbDrone.Core/ProgressMessaging/ProgressMessageContext.cs +++ b/src/NzbDrone.Core/ProgressMessaging/ProgressMessageContext.cs @@ -1,10 +1,13 @@ -using System; +using System; +using System.Threading; using NzbDrone.Core.Messaging.Commands; namespace NzbDrone.Core.ProgressMessaging { public static class ProgressMessageContext { + private static AsyncLocal _commandModelAsync = new AsyncLocal(); + [ThreadStatic] private static CommandModel _commandModel; @@ -13,8 +16,15 @@ namespace NzbDrone.Core.ProgressMessaging public static CommandModel CommandModel { - get { return _commandModel; } - set { _commandModel = value; } + get + { + return _commandModel ?? _commandModelAsync.Value; + } + set + { + _commandModel = value; + _commandModelAsync.Value = value; + } } public static bool LockReentrancy() diff --git a/src/NzbDrone.Core/Update/Commands/ApplicationUpdateCommand.cs b/src/NzbDrone.Core/Update/Commands/ApplicationUpdateCommand.cs index 0ca1d8074..59a827a0b 100644 --- a/src/NzbDrone.Core/Update/Commands/ApplicationUpdateCommand.cs +++ b/src/NzbDrone.Core/Update/Commands/ApplicationUpdateCommand.cs @@ -6,7 +6,5 @@ namespace NzbDrone.Core.Update.Commands { public override bool SendUpdatesToClient => true; public override bool IsExclusive => true; - - public override string CompletionMessage => null; } }