Make unfavouriting async to prevent timeout errors from leaving orphaned records behind
This commit is contained in:
		
					parent
					
						
							
								6b67b55cee
							
						
					
				
			
			
				commit
				
					
						0542773bca
					
				
			
		
					 3 changed files with 15 additions and 2 deletions
				
			
		
							
								
								
									
										9
									
								
								app/workers/unfavourite_worker.rb
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								app/workers/unfavourite_worker.rb
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,9 @@ | |||
| # frozen_string_literal: true | ||||
| 
 | ||||
| class UnfavouriteWorker | ||||
|   include Sidekiq::Worker | ||||
| 
 | ||||
|   def perform(account_id, status_id) | ||||
|     UnfavouriteService.new.call(Account.find(account_id), Status.find(status_id)) | ||||
|   end | ||||
| end | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue