Exemplo n.º 1
0
 /// <summary>
 /// cleanup the stake session data.
 /// </summary>
 /// <param name="isStaleSessionCallback">the callback to judge whether </param>
 public static async Task CleanupStaleSessionData(IsStaleSessionCallback isStaleSessionCallback, string connectString)
 {
     if (!SoaHelper.IsOnAzure())
     {
         // TODO: on azure, about MSMQ
         await BrokerQueueFactory.CleanupStalePersistedData("azurequeue", isStaleSessionCallback, connectString);
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// cleanup the stale persisted data for the sessions that related jobs are purged by the scheduler.
 /// </summary>
 /// <param name="persistName">the persist name.</param>
 /// <param name="isStaleSessionCallback">the calback function to judge whether a session is stale.</param>
 public static async Task CleanupStalePersistedData(string persistName, IsStaleSessionCallback isStaleSessionCallback, string connectString)
 {
     ParamCheckUtility.ThrowIfNull(isStaleSessionCallback, "isStaleSessionCallback");
     if (!string.IsNullOrEmpty(persistName))
     {
         if (persistName.Trim().Equals("AzureQueue", StringComparison.OrdinalIgnoreCase))
         {
             BrokerTracing.TraceInfo(
                 "[BrokerQueueFactory] .CleanupStalePersistedData: cleaning up stale data in AzureQueue");
             await AzureQueuePersist
             .CleanupStaleMessageQueue(isStaleSessionCallback, connectString);
         }
         else
         {
             throw new ArgumentOutOfRangeException("persistName",
                                                   persistName + ", which persistence is not supported.");
         }
     }
 }