mirror of
				https://github.com/lingble/chatwoot.git
				synced 2025-10-31 19:17:48 +00:00 
			
		
		
		
	 e7b01d80b3
			
		
	
	e7b01d80b3
	
	
	
		
			
			- scripts to throttle reindex job creation and monitor progress ``` RAILS_ENV=production POSTGRES_STATEMENT_TIMEOUT=6000s bundle exec rails runner script/bulk_reindex_messages.rb RAILS_ENV=production bundle exec rails runner script/monitor_reindex.rb ``` --------- Co-authored-by: Pranav <pranavrajs@gmail.com>
		
			
				
	
	
		
			20 lines
		
	
	
		
			592 B
		
	
	
	
		
			Ruby
		
	
	
	
	
	
			
		
		
	
	
			20 lines
		
	
	
		
			592 B
		
	
	
	
		
			Ruby
		
	
	
	
	
	
| # Monitor bulk reindex progress
 | |
| # RAILS_ENV=production bundle exec rails runner script/monitor_reindex.rb
 | |
| 
 | |
| puts 'Monitoring bulk reindex progress (Ctrl+C to stop)...'
 | |
| puts ''
 | |
| 
 | |
| loop do
 | |
|   bulk_queue = Sidekiq::Queue.new('bulk_reindex_low')
 | |
|   prod_queue = Sidekiq::Queue.new('async_database_migration')
 | |
|   retry_set = Sidekiq::RetrySet.new
 | |
| 
 | |
|   puts "[#{Time.zone.now.strftime('%Y-%m-%d %H:%M:%S')}]"
 | |
|   puts "  Bulk Reindex Queue: #{bulk_queue.size} jobs"
 | |
|   puts "  Production Queue: #{prod_queue.size} jobs"
 | |
|   puts "  Retry Queue: #{retry_set.size} jobs"
 | |
|   puts "  #{('-' * 60)}"
 | |
| 
 | |
|   sleep(30)
 | |
| end
 |