Skip to content

Commit

Permalink
Update formatting of force processing backlog
Browse files Browse the repository at this point in the history
  • Loading branch information
ktuite committed Aug 22, 2024
1 parent 571c2f1 commit b64f783
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion lib/model/query/entities.js
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,8 @@ const processHeldSubmissions = (force = false) => async (container) => {
async () => {
await container.Entities._deleteHeldSubmissionByEventId(event.id);
return processSubmissionEvent(event, { details: { force: true } })(container);
}));
}))
.then(() => events.length);
};

////////////////////////////////////////////////////////////////////////////////
Expand Down
2 changes: 1 addition & 1 deletion lib/task/process-held-submissions.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019 ODK Central Developers
// 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
Expand Down
4 changes: 3 additions & 1 deletion test/integration/api/offline-entities.js
Original file line number Diff line number Diff line change
Expand Up @@ -1106,7 +1106,9 @@ describe('Offline Entities', () => {
backlogCount.should.equal(2);

// Process submissions that have been in the backlog for a long time
await container.Entities.processHeldSubmissions();
// (only 1 of 2 should be processed)
const count = await container.Entities.processHeldSubmissions();
count.should.equal(1);

await asAlice.get('/v1/projects/1/datasets/people/entities/12345678-1234-4123-8234-123456789abc')
.expect(200)
Expand Down

0 comments on commit b64f783

Please sign in to comment.