app.js 504 B

1234567891011121314151617181920
  1. 'use strict';
  2. const _ = require('lodash');
  3. const colors = require('colors');
  4. class AppBootHook {
  5. constructor(app) {
  6. this.app = app;
  7. }
  8. async willReady() {}
  9. async serverDidReady() {
  10. // 应用已经启动完毕
  11. const ctx = await this.app.createAnonymousContext();
  12. ctx.service.util.install.init();
  13. // 初始化死信机制
  14. ctx.service.util.rabbitMq.initDeadProcess();
  15. // await ctx.service.util.rabbitMq.mission();
  16. }
  17. }
  18. module.exports = AppBootHook;