default-job-queue-plugin.ts 632 B

123456789101112131415161718192021
  1. import { PluginCommonModule } from '../plugin-common.module';
  2. import { VendurePlugin } from '../vendure-plugin';
  3. import { JobRecord } from './job-record.entity';
  4. import { SqlJobQueueStrategy } from './sql-job-queue-strategy';
  5. /**
  6. * @description
  7. * A plugin which configures Vendure to use the SQL database to persist the JobQueue jobs.
  8. *
  9. * @docsCategory JobQueue
  10. */
  11. @VendurePlugin({
  12. imports: [PluginCommonModule],
  13. entities: [JobRecord],
  14. configuration: (config) => {
  15. config.jobQueueOptions.jobQueueStrategy = new SqlJobQueueStrategy();
  16. return config;
  17. },
  18. })
  19. export class DefaultJobQueuePlugin {}