Skip to content

Commit

Permalink
fix: Skip io.cozy.jobs queries
Browse files Browse the repository at this point in the history
`io.cozy.jobs` take very long time to be queried when using a local
PouchDB

This commit early return an empty array of jobs instead of actually
doing the query so we can display cozy-home faster until we find a
better solution
  • Loading branch information
Ldoppea committed Sep 25, 2024
1 parent 64a0eee commit a15a4cd
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/libs/intents/flagshipLink.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,21 @@ export const flagshipLinkRequest = async (
)
}

// Temporary skip `io.cozy.jobs` queries as they are not mandatory
// to display cozy-home but are very long to be executed (>20s) and
// delay cozy-home first draw
// Should be removed when we find an optimisation for `io.cozy.jobs`
if (operation.doctype === 'io.cozy.jobs') {
return {
data: [],
meta: {
count: 0
},
next: false,
skip: 0
}
}

// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
const result = await client.query(operation)

Expand Down

0 comments on commit a15a4cd

Please sign in to comment.