import { startQueueProcessor, stopQueueProcessor } from '../utils/queueProcessor';

export default defineNitroPlugin((nitroApp) => {
  console.log('📦 Initializing notification queue processor plugin...');

  // Start the queue processor when the server starts
  startQueueProcessor();

  // Optional: Stop gracefully on server shutdown
  nitroApp.hooks.hook('close', () => {
    console.log('🛑 Shutting down queue processor...');
    stopQueueProcessor();
  });
});
