Skip to content

Commit 0223df8

Browse files
committed
chore: Add updateStatus query parameter to BackendsController
1 parent 59b7ad5 commit 0223df8

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

src/core/backends/backends.controller.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ export class BackendsController {
7676
@Query('async') asyncQuery: string,
7777
@Query('timeoutDiscard') timeoutDiscardQuery: string,
7878
@Query('disableLogs') disableLogsQuery: string,
79+
@Query('updateStatus') updateStatusQuery: string,
7980
@Query(
8081
'syncTimeout',
8182
new ParseIntPipe({
@@ -88,6 +89,7 @@ export class BackendsController {
8889
const async = /true|on|yes|1/i.test(asyncQuery);
8990
const timeoutDiscard = /true|on|yes|1/i.test(timeoutDiscardQuery);
9091
const disableLogs = /true|on|yes|1/i.test(disableLogsQuery);
92+
const updateStatus = /true|on|yes|1/i.test(updateStatusQuery);
9193
const [job, response] = await this.backendsService.executeJob(
9294
body.action,
9395
body.id ? new Types.ObjectId(body.id) : null,
@@ -97,6 +99,7 @@ export class BackendsController {
9799
syncTimeout,
98100
timeoutDiscard,
99101
disableLogs,
102+
updateStatus,
100103
},
101104
);
102105
return res.status(HttpStatus.ACCEPTED).json({ async, job, response });

src/core/backends/backends.service.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ export class BackendsService extends AbstractQueueProcessor {
150150
{ identity },
151151
{
152152
...options,
153+
updateStatus: true,
153154
task: task._id,
154155
},
155156
);
@@ -196,6 +197,7 @@ export class BackendsService extends AbstractQueueProcessor {
196197
for (const identity of identities) {
197198
const [executedJob] = await this.executeJob(identity.action, identity.identity._id, identity.identity, {
198199
...options,
200+
updateStatus: true,
199201
task: task._id,
200202
});
201203
result[identity.identity._id] = executedJob;

src/management/passwd/passwd.service.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ export class PasswdService extends AbstractService {
5252
async: false,
5353
timeoutDiscard: true,
5454
disableLogs: true,
55+
updateStatus: false,
5556
});
5657
} catch (e) {
5758
this.logger.error("Error while changing password. " + e + ` (uid=${passwdDto?.uid})`);
@@ -124,6 +125,7 @@ export class PasswdService extends AbstractService {
124125
async: false,
125126
timeoutDiscard: true,
126127
disableLogs: true,
128+
updateStatus: false,
127129
},
128130
);
129131

0 commit comments

Comments
 (0)