-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#2180 - Queued Assessments - Assessment Workflow Enqueuer Scheduler -…
… Start Assessment (Part 1) (#2285) - Created the new queue configuration for the scheduler, executed every 30 seconds, and cleaned up every 24 hours. - Removed from the code the points where the queue to start the workflow was invoked. From now on only the scheduler will invoke the workflow start queue. - Method `startAssessment` removed since it is no longer needed. - Method `hasIncompleteAssessment` and `assertAllAssessmentsCompleted` removed since there is no purpose anymore. - Multiple workflows can now be saved and the scheduler will coordinate their execution. - `StartApplicationAssessment` queue can now be started without providing the `workflowName`. - Created a migration to update the assessment status based on `assessment_workflow_id`, and `assessment_data`. The rollback is less meaningful and it was created to try to bring the column back to its original state where the column was set with its default value `Submitted`.
- Loading branch information
1 parent
28fe367
commit 672f0a4
Showing
25 changed files
with
422 additions
and
178 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
...end/apps/db-migrations/src/migrations/1694116500443-AddAssessmentWorkflowEnqueuerQueue.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 AddAssessmentWorkflowEnqueuerQueue1694116500443 | ||
implements MigrationInterface | ||
{ | ||
public async up(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query( | ||
getSQLFileData("Add-assessment-workflow-enqueuer-queue.sql", "Queue"), | ||
); | ||
} | ||
|
||
public async down(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query( | ||
getSQLFileData( | ||
"Rollback-add-assessment-workflow-enqueuer-queue.sql", | ||
"Queue", | ||
), | ||
); | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
.../backend/apps/db-migrations/src/migrations/1694202849264-UpdateStudentAssessmentStatus.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { MigrationInterface, QueryRunner } from "typeorm"; | ||
import { getSQLFileData } from "../utilities/sqlLoader"; | ||
|
||
export class UpdateStudentAssessmentStatus1694202849264 | ||
implements MigrationInterface | ||
{ | ||
public async up(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query( | ||
getSQLFileData( | ||
"Update-student-assessment-status.sql", | ||
"StudentAssessments", | ||
), | ||
); | ||
} | ||
|
||
public async down(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query( | ||
getSQLFileData( | ||
"Rollback-update-student-assessment-status.sql", | ||
"StudentAssessments", | ||
), | ||
); | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
...kages/backend/apps/db-migrations/src/sql/Queue/Add-assessment-workflow-enqueuer-queue.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
INSERT INTO | ||
sims.queue_configurations(queue_name, queue_configuration) | ||
VALUES | ||
( | ||
'assessment-workflow-enqueuer', | ||
'{ | ||
"dashboardReadonly": false, | ||
"cron": "*/30 * * * * *", | ||
"cleanUpPeriod": 3600000 | ||
}' :: json | ||
); |
4 changes: 4 additions & 0 deletions
4
...kend/apps/db-migrations/src/sql/Queue/Rollback-add-assessment-workflow-enqueuer-queue.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
DELETE FROM | ||
sims.queue_configurations | ||
WHERE | ||
queue_name = 'assessment-workflow-enqueuer'; |
Oops, something went wrong.