File tree Expand file tree Collapse file tree 1 file changed +12
-9
lines changed Expand file tree Collapse file tree 1 file changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -57,25 +57,28 @@ func (srv *SynchronizeWithLivekitService) DoJob() {
5757}
5858
5959func  (srv  * SynchronizeWithLivekitService ) cleanOrphans (ctx  context.Context ) {
60- 	err  :=  db . Transact ( srv . database ,  func ( tx   * db. Tx )  error  { 
61- 		 offset  :=  int64 ( 0 ) 
62- 		 hasMoreElements  :=   true 
63- 		for   hasMoreElements  {
60+ 	offset  :=  int64 ( 0 ) 
61+ 	hasMoreElements  :=  true 
62+ 	for   hasMoreElements  { 
63+ 		err   :=   db . Transact ( srv . database ,  func ( tx   * db. Tx )  error  {
6464			// here we use order by owner_id 
6565			batchUserStates , err  :=  tx .GetAllUserStates (utils .DefaultSize , offset )
6666			if  err  !=  nil  {
6767				GetLogEntry (ctx ).Errorf ("error during reading user states %v" , err )
68- 				continue 
68+ 				return   err 
6969			}
7070			srv .processBatch (ctx , tx , batchUserStates )
7171
7272			hasMoreElements  =  len (batchUserStates ) ==  utils .DefaultSize 
7373			offset  +=  utils .DefaultSize 
74+ 
75+ 			return  nil 
76+ 		})
77+ 
78+ 		if  err  !=  nil  {
79+ 			GetLogEntry (ctx ).Errorf ("error during processing: %v" , err )
80+ 			continue 
7481		}
75- 		return  nil 
76- 	})
77- 	if  err  !=  nil  {
78- 		GetLogEntry (ctx ).Errorf ("Error during processing: %v" , err )
7982	}
8083}
8184
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments