log test publish
All checks were successful
Build & Deploy on Dev / build (push) Successful in 1m15s
All checks were successful
Build & Deploy on Dev / build (push) Successful in 1m15s
This commit is contained in:
parent
2aaaf53ab0
commit
3ccdb691f6
2 changed files with 135 additions and 25 deletions
|
|
@ -2532,11 +2532,16 @@ export class OrganizationController extends Controller {
|
|||
* Cronjob
|
||||
*/
|
||||
async cronjobRevision() {
|
||||
console.log('[CronJob] cronjobRevision START');
|
||||
const startTime = Date.now();
|
||||
|
||||
const today = new Date();
|
||||
today.setUTCHours(0, 0, 0, 0); // Set time to the beginning of the day
|
||||
const tomorrow = new Date(today);
|
||||
tomorrow.setDate(tomorrow.getDate() + 1);
|
||||
|
||||
console.log(`[CronJob] Searching for draft revision with publishDate between ${today.toISOString()} and ${tomorrow.toISOString()}`);
|
||||
|
||||
const orgRevisionDraft = await this.orgRevisionRepository
|
||||
.createQueryBuilder("orgRevision")
|
||||
.where("orgRevision.orgRevisionIsDraft = true")
|
||||
|
|
@ -2545,8 +2550,12 @@ export class OrganizationController extends Controller {
|
|||
.getOne();
|
||||
|
||||
if (!orgRevisionDraft) {
|
||||
console.log('[CronJob] No draft revision found to publish');
|
||||
return new HttpSuccess();
|
||||
}
|
||||
|
||||
console.log(`[CronJob] Found draft revision: ${orgRevisionDraft.id}, name: ${orgRevisionDraft.orgRevisionName}, publishDate: ${orgRevisionDraft.orgPublishDate}`);
|
||||
|
||||
// if (orgRevisionPublish) {
|
||||
// orgRevisionPublish.orgRevisionIsDraft = false;
|
||||
// orgRevisionPublish.orgRevisionIsCurrent = false;
|
||||
|
|
@ -2575,7 +2584,10 @@ export class OrganizationController extends Controller {
|
|||
lastUpdatedAt: new Date(),
|
||||
},
|
||||
};
|
||||
|
||||
console.log(`[CronJob] Sending to RabbitMQ queue - revisionId: ${orgRevisionDraft.id}`);
|
||||
sendToQueueOrg(msg);
|
||||
console.log(`[CronJob] Sent to queue successfully - Total time: ${Date.now() - startTime}ms`);
|
||||
return new HttpSuccess();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue