Beispiel #1
0
 public void Handle(ProjectionManagementMessage.Internal.CleanupExpired message)
 {
     //TODO: configurable expiration
     if (IsExpiredProjection())
     {
         if (_state == ManagedProjectionState.Creating)
         {
             // NOTE: workaround for stop not working on creating state (just ignore them)
             return;
         }
         Stop(
             () =>
             Handle(
                 new ProjectionManagementMessage.Delete(
                     new NoopEnvelope(), _name, ProjectionManagementMessage.RunAs.System, false, false)));
     }
 }
Beispiel #2
0
 public void Handle(ProjectionManagementMessage.Internal.CleanupExpired message)
 {
     //TODO: configurable expiration
     if (Mode == ProjectionMode.Transient)
     {
         if (_lastAccessed.AddMinutes(5) < _timeProvider.Now)
         {
             if (_state == ManagedProjectionState.Creating)
             {
                 // NOTE: workaround for stop not working on creating state (just ignore them)
                 return;
             }
             Stop(
                 () =>
                 Handle(
                     new ProjectionManagementMessage.Delete(
                         new NoopEnvelope(), _name, ProjectionManagementMessage.RunAs.System, false, false)));
         }
     }
 }
Beispiel #3
0
 public void Handle(ProjectionManagementMessage.Internal.CleanupExpired message)
 {
     ScheduleExpire();
     CleanupExpired();
 }