Skip to content

Commit

Permalink
Remove unexpected delay parameter on server API requests (#6778)
Browse files Browse the repository at this point in the history
* fix: remove unexpected delay parameter on delayed server API requests

* changelog: add pull request entry

* fix(changelog): typo

* fix: typo

---------

Co-authored-by: Luciano Gorza <[email protected]>
  • Loading branch information
Desvelao and lucianogorza authored Jun 19, 2024
1 parent 29c9758 commit 9c43088
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ All notable changes to the Wazuh app project will be documented in this file.

### Fixed

- Removed the unexpected `delay` parameter on the server API requests [#6778](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6778)
- Fixed home KPI links with custom or index pattern whose title is different to the id [#6777](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6777)

## Wazuh v4.8.0 - OpenSearch Dashboards 2.10.0 - Revision 12
Expand Down
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) {
// Remove 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 9c43088

Please sign in to comment.