add factory method

This commit is contained in:
Alex Holliday
2025-06-08 09:01:30 +08:00
parent 8de2c0387c
commit afbd1157c0
2 changed files with 12 additions and 2 deletions
+6 -1
View File
@@ -10,7 +10,12 @@ class PulseQueue {
this.appSettings = appSettings;
this.pulseQueueHelper = pulseQueueHelper;
this.logger = logger;
this.init();
}
static async create({ appSettings, db, pulseQueueHelper, logger }) {
const instance = new PulseQueue({ appSettings, db, pulseQueueHelper, logger });
await instance.init();
return instance;
}
// ****************************************