mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
* Fix task manager query to also return tasks to retry * Fix failing jest tests
This commit is contained in:
parent
e68fe90c85
commit
051d9f6dce
2 changed files with 6 additions and 5 deletions
|
@ -11,7 +11,7 @@ import {
|
|||
RangeFilter,
|
||||
mustBeAllOf,
|
||||
MustCondition,
|
||||
MustNotCondition,
|
||||
BoolClauseWithAnyCondition,
|
||||
} from './query_clauses';
|
||||
|
||||
export const TaskWithSchedule: ExistsFilter = {
|
||||
|
@ -54,15 +54,16 @@ export const IdleTaskWithExpiredRunAt: MustCondition<TermFilter | RangeFilter> =
|
|||
},
|
||||
};
|
||||
|
||||
export const InactiveTasks: MustNotCondition<TermFilter | RangeFilter> = {
|
||||
// TODO: Fix query clauses to support this
|
||||
export const InactiveTasks: BoolClauseWithAnyCondition<any> = {
|
||||
bool: {
|
||||
must_not: [
|
||||
{
|
||||
bool: {
|
||||
should: [{ term: { 'task.status': 'running' } }, { term: { 'task.status': 'claiming' } }],
|
||||
must: { range: { 'task.retryAt': { gt: 'now' } } },
|
||||
},
|
||||
},
|
||||
{ range: { 'task.retryAt': { gt: 'now' } } },
|
||||
],
|
||||
},
|
||||
};
|
||||
|
|
|
@ -407,9 +407,9 @@ describe('TaskStore', () => {
|
|||
{ term: { 'task.status': 'running' } },
|
||||
{ term: { 'task.status': 'claiming' } },
|
||||
],
|
||||
must: { range: { 'task.retryAt': { gt: 'now' } } },
|
||||
},
|
||||
},
|
||||
{ range: { 'task.retryAt': { gt: 'now' } } },
|
||||
],
|
||||
},
|
||||
},
|
||||
|
@ -553,9 +553,9 @@ describe('TaskStore', () => {
|
|||
{ term: { 'task.status': 'running' } },
|
||||
{ term: { 'task.status': 'claiming' } },
|
||||
],
|
||||
must: { range: { 'task.retryAt': { gt: 'now' } } },
|
||||
},
|
||||
},
|
||||
{ range: { 'task.retryAt': { gt: 'now' } } },
|
||||
],
|
||||
},
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue