Skip to content

Commit

Permalink
fix: remove unexpected delay parameter on delayed server API requests
Browse files Browse the repository at this point in the history
  • Loading branch information
Desvelao committed Jun 18, 2024
1 parent 97a1825 commit 9994219
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions plugins/main/server/controllers/wazuh-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -721,6 +721,11 @@ export class WazuhApiCtrl {
}
const delay = (data || {}).delay || 0;
if (delay) {
// Removes the delay parameter that is used to add the sever API request to the queue job.
// This assumes the delay parameter is not used as part of the server API request. If it
// was expected to do a request with a 'delay' parameter then we would have to search a
// way to differenciate if the parameter is related to job queue or API request.
delete data.delay;
addJobToQueue({
startAt: new Date(Date.now() + delay),
run: async () => {
Expand Down

0 comments on commit 9994219

Please sign in to comment.