-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Force-process entity submissions held in backlog (#1172)
* Force-process entity submissions held in backlog * Make task actually run * Update formatting of force processing backlog * Rename task to reference backlog * Adding tests for force processing backlog for deleted entity or submission * Dont force process a sub for a deleted entity * Add transaction to backlog processor task * pass baseVersion through in force create * more empty label cases for update as create
- Loading branch information
Showing
5 changed files
with
598 additions
and
21 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// Copyright 2024 ODK Central Developers | ||
// See the NOTICE file at the top-level directory of this distribution and at | ||
// https://github.com/getodk/central-backend/blob/master/NOTICE. | ||
// This file is part of ODK Central. It is subject to the license terms in | ||
// the LICENSE file found in the top-level directory of this distribution and at | ||
// https://www.apache.org/licenses/LICENSE-2.0. No part of ODK Central, | ||
// including this file, may be copied, modified, propagated, or distributed | ||
// except according to the terms contained in the LICENSE file. | ||
// | ||
// This script re-processes submissions containing offline entity actions that | ||
// were previously held in a backlog due to submissions coming in out of order. | ||
|
||
const { run } = require('../task/task'); | ||
const { processBacklog } = require('../task/process-backlog'); | ||
|
||
const { program } = require('commander'); | ||
program.option('-f, --force', 'Force all submissions in the backlog to be processed immediately.'); | ||
program.parse(); | ||
|
||
const options = program.opts(); | ||
|
||
run(processBacklog(options.force) | ||
.then((count) => `Submissions processed: ${count}`)); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// Copyright 2024 ODK Central Developers | ||
// See the NOTICE file at the top-level directory of this distribution and at | ||
// https://github.com/getodk/central-backend/blob/master/NOTICE. | ||
// This file is part of ODK Central. It is subject to the license terms in | ||
// the LICENSE file found in the top-level directory of this distribution and at | ||
// https://www.apache.org/licenses/LICENSE-2.0. No part of ODK Central, | ||
// including this file, may be copied, modified, propagated, or distributed | ||
// except according to the terms contained in the LICENSE file. | ||
|
||
const { task } = require('./task'); | ||
const processBacklog = task.withContainer(({ Entities }) => Entities.processBacklog); | ||
module.exports = { processBacklog }; | ||
|
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
Oops, something went wrong.