File tree Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -45,8 +45,8 @@ private Persistence(
4545    /// </summary> 
4646    public  long  Index  {  get ;  private  set ;  }  =  - 1 ; 
4747
48-     private  bool  UsingSnapshotting  =>  _applySnapshot  is  not null ;   //TODO: why not used? 
49-     private  bool  UsingEventSourcing  =>  _applyEvent  is  not null ; 
48+     private  bool  UsingSnapshotting  =>  _applySnapshot  is  not null ; 
49+     private  bool  UsingEventSourcing  =>  _applyEvent  is  not null ; 
5050
5151    /// <summary> 
5252    ///     Initializes <see cref="Persistence" /> with event storing only. 
@@ -216,13 +216,13 @@ Func<object> getSnapshot
216216    /// <returns></returns> 
217217    public  async  Task  RecoverStateAsync ( ) 
218218    { 
219-         var  ( snapshot ,  lastSnapshotIndex )  =  await  _snapshotStore . GetSnapshotAsync ( _actorId ) . ConfigureAwait ( false ) ; 
220- 
221-         if  ( snapshot  is  not null  &&  _applySnapshot   is  not  null ) 
222-         { 
223-             Index  =  lastSnapshotIndex ; 
224-             _applySnapshot ( new  RecoverSnapshot ( snapshot ,  lastSnapshotIndex ) ) ; 
225-         } 
219+         var  ( snapshot ,  lastSnapshotIndex )  =  await  _snapshotStore . GetSnapshotAsync ( _actorId ) . ConfigureAwait ( false ) ; 
220+ 
221+         if  ( snapshot  is  not null  &&  UsingSnapshotting ) 
222+         { 
223+             Index  =  lastSnapshotIndex ; 
224+             _applySnapshot ! ( new  RecoverSnapshot ( snapshot ,  lastSnapshotIndex ) ) ; 
225+         } 
226226
227227        var  fromEventIndex  =  Index  +  1 ; 
228228
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments