Skip to content

Commit

Permalink
#1652 - Update Scheduler Cron Job (#3659)
Browse files Browse the repository at this point in the history
# Update the Scheduler Cron Configuration

## Updated scheduler Cron
As per the ticket, the scheduler cron values have been updated after
converting the given PST time in the ticket to UTC time.


| Scheduler | PST TIME | UTC TIME | CRON EXPRESSION |
| ------------------------------------------------ | -------- | --------
| --------------------- |
| ier12-integration | \- | \- | `15/30 * * * *` |
| | | | |
| cra-process-integration | 21:00 | 05:00 | `0 5 * * *` |
| cra-response-integration | 08:00 | 16:00 | `0 16 * * *` |
| | | | |
| sin-validation-process-integration | 06:00 | 14:00 | `0 14 * * *` |
| sin-validation-response-integration | 06:00 | 14:00 | `0 14 * * *` |
| | | | |
| part-time-msfaa-process-integration | 00:00 | 08:00 | `0 8 * * *` |
| | | | |
| part-time-e-cert-integration | 00:00 | 08:00 | `0 8 * * *` |
| part-time-feedback-integration | 04:00 | 12:00 | `0 12 * * *` |
| | | | |
| full-time-msfaa-integration | 01:00 | 09:00 | `0 9 * * *` |
| | | | |
| full-time-e-cert-integration | 22:00 | 06:00 | `0 6 * * *` |
| full-time-feedback-integration | 12:00 | 20:00 | `0 20 * * *` |
| | | | |
| federal-restrictions-integration | 05:00 | 13:00 | `0 13 * * *` |
| | | | |
| full-time-disbursement-receipts-file-integration | 10:30 | 18:30 | `30
18 * * *` |
| | | | |
| ece-process-integration | 22:00 | 06:00 | `0 6 * * *` |
| ece-process-response-integration | 01:45 | 09:45 | `45 09 * * *` |
| | | | |
| part-time-msfaa-process-response-integration | 04:00 | 12:00 | `0 12 *
* *` |
| full-time-msfaa-process-response-integration | 09:15 | 17:15 | `15 17
* * *` |
| | | | |
| student-loan-balances-part-time-integration | 22:30 | 06:30 | `30 6 *
* *` |
| sfas-integration | - | - | `15/30 * * * *` |

## Existing cron


![image](https://github.com/user-attachments/assets/29f131ec-5019-485d-8121-0731424f4a7c)


## PR Highlights

- [x] Updated a particular property of JSONB column using `jsonb_set` 


![image](https://github.com/user-attachments/assets/0c03d9c5-f285-4404-b6f9-e149a94c7a50)

- [x] SIN validation response processing was using the queue name
`sin-validation-request-integration` and respective scheduler name. Both
queue names and scheduler names have been updated.

## Migration Rollback


![image](https://github.com/user-attachments/assets/a331eacc-9f6e-4e12-832e-9610948caeca)


![image](https://github.com/user-attachments/assets/bc357a72-a8c0-4945-b4e0-c054ff1c7c9f)


![image](https://github.com/user-attachments/assets/176312d6-35c9-4dd0-8395-747e4c19d731)
  • Loading branch information
dheepak-aot authored Aug 27, 2024
1 parent 1cdadda commit c3e1405
Show file tree
Hide file tree
Showing 9 changed files with 514 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { MigrationInterface, QueryRunner } from "typeorm";
import { getSQLFileData } from "../utilities/sqlLoader";

export class UpdateConfigurationSchedulerCron1724722614598
implements MigrationInterface
{
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
getSQLFileData("Update-configuration-scheduler-cron.sql", "Queue"),
);
}

public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
getSQLFileData(
"Rollback-update-configuration-scheduler-cron.sql",
"Queue",
),
);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { MigrationInterface, QueryRunner } from "typeorm";
import { getSQLFileData } from "../utilities/sqlLoader";

export class UpdateQueueNameSINValidationRequest1724724771391
implements MigrationInterface
{
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
getSQLFileData("Update-queue-name-sin-validation-request.sql", "Queue"),
);
}

public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
getSQLFileData(
"Rollback-update-queue-name-sin-validation-request.sql",
"Queue",
),
);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,227 @@
update
sims.queue_configurations
set
queue_configuration = jsonb_set(
queue_configuration,
'{cron}',
'"0 14 * * *"',
false
)
where
queue_name = 'ier12-integration';

update
sims.queue_configurations
set
queue_configuration = jsonb_set(
queue_configuration,
'{cron}',
'"0 2,8,14,20 * * *"',
false
)
where
queue_name = 'cra-process-integration';

update
sims.queue_configurations
set
queue_configuration = jsonb_set(
queue_configuration,
'{cron}',
'"0 5,11,17,23 * * *"',
false
)
where
queue_name = 'cra-response-integration';

update
sims.queue_configurations
set
queue_configuration = jsonb_set(
queue_configuration,
'{cron}',
'"0 17 * * *"',
false
)
where
queue_name = 'sin-validation-process-integration';

update
sims.queue_configurations
set
queue_configuration = jsonb_set(
queue_configuration,
'{cron}',
'"0 17 * * *"',
false
)
where
queue_name = 'sin-validation-request-integration';

update
sims.queue_configurations
set
queue_configuration = jsonb_set(
queue_configuration,
'{cron}',
'"0 14 * * *"',
false
)
where
queue_name = 'part-time-msfaa-process-integration';

update
sims.queue_configurations
set
queue_configuration = jsonb_set(
queue_configuration,
'{cron}',
'"0 14 * * *"',
false
)
where
queue_name = 'part-time-e-cert-integration';

update
sims.queue_configurations
set
queue_configuration = jsonb_set(
queue_configuration,
'{cron}',
'"0 17 * * *"',
false
)
where
queue_name = 'part-time-feedback-integration';

update
sims.queue_configurations
set
queue_configuration = jsonb_set(
queue_configuration,
'{cron}',
'"0 14 * * *"',
false
)
where
queue_name = 'full-time-msfaa-integration';

update
sims.queue_configurations
set
queue_configuration = jsonb_set(
queue_configuration,
'{cron}',
'"0 14 * * *"',
false
)
where
queue_name = 'full-time-e-cert-integration';

update
sims.queue_configurations
set
queue_configuration = jsonb_set(
queue_configuration,
'{cron}',
'"0 17 * * *"',
false
)
where
queue_name = 'full-time-feedback-integration';

update
sims.queue_configurations
set
queue_configuration = jsonb_set(
queue_configuration,
'{cron}',
'"0 11 * * *"',
false
)
where
queue_name = 'federal-restrictions-integration';

update
sims.queue_configurations
set
queue_configuration = jsonb_set(
queue_configuration,
'{cron}',
'"0 17 * * *"',
false
)
where
queue_name = 'disbursement-receipts-file-integration';

update
sims.queue_configurations
set
queue_configuration = jsonb_set(
queue_configuration,
'{cron}',
'"0 14 * * *"',
false
)
where
queue_name = 'ece-process-integration';

update
sims.queue_configurations
set
queue_configuration = jsonb_set(
queue_configuration,
'{cron}',
'"0 14 * * *"',
false
)
where
queue_name = 'ece-process-response-integration';

update
sims.queue_configurations
set
queue_configuration = jsonb_set(
queue_configuration,
'{cron}',
'"0 17 * * *"',
false
)
where
queue_name = 'part-time-msfaa-process-response-integration';

update
sims.queue_configurations
set
queue_configuration = jsonb_set(
queue_configuration,
'{cron}',
'"0 17 * * *"',
false
)
where
queue_name = 'full-time-msfaa-process-response-integration';

update
sims.queue_configurations
set
queue_configuration = jsonb_set(
queue_configuration,
'{cron}',
'"0 17 * * *"',
false
)
where
queue_name = 'student-loan-balances-part-time-integration';

update
sims.queue_configurations
set
queue_configuration = jsonb_set(
queue_configuration,
'{cron}',
'"0 12 * * *"',
false
)
where
queue_name = 'sfas-integration';
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
update
sims.queue_configurations
set
queue_name = 'sin-validation-request-integration'
where
queue_name = 'sin-validation-response-integration';
Loading

0 comments on commit c3e1405

Please sign in to comment.