MCPcopy
hub / github.com/omkarcloud/botasaurus / queryPendingTasks

Function queryPendingTasks

js/botasaurus-server-js/src/task-executor.ts:31–40  ·  view source on GitHub ↗
(maxTasks: number | null, query: any)

Source from the content-addressed store, hash-verified

29}
30
31async function queryPendingTasks(maxTasks: number | null, query: any) {
32 if (isNotNullish(maxTasks)) {
33 // @ts-ignore
34 return db.findAsync(query).sort({ priority: -1, sort_id: -1 }).limit(maxTasks) as unknown as Task[]
35
36 } else {
37 return await db.findAsync(query).sort({ priority: -1, sort_id: -1 }) as unknown as Task[]
38
39 }
40}
41
42
43export async function getPendingTasks(query: any, maxTasks: number | null) {

Callers 1

getPendingTasksFunction · 0.85

Calls 2

isNotNullishFunction · 0.90
sortMethod · 0.80

Tested by

no test coverage detected