You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-11-26 22:41:17 +02:00
Server: Increase number of items that are returned during sync
This commit is contained in:
@@ -34,7 +34,7 @@ export interface ChangePreviousItem {
|
|||||||
|
|
||||||
export function defaultDeltaPagination(): ChangePagination {
|
export function defaultDeltaPagination(): ChangePagination {
|
||||||
return {
|
return {
|
||||||
limit: 100,
|
limit: 200,
|
||||||
cursor: '',
|
cursor: '',
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -139,6 +139,8 @@ export default class ChangeModel extends BaseModel<Change> {
|
|||||||
// as the `changes` table grew. So it is now split into two queries
|
// as the `changes` table grew. So it is now split into two queries
|
||||||
// merged by a UNION ALL.
|
// merged by a UNION ALL.
|
||||||
|
|
||||||
|
const subQueryLimit = Math.ceil(limit / 2);
|
||||||
|
|
||||||
const fields = [
|
const fields = [
|
||||||
'id',
|
'id',
|
||||||
'item_id',
|
'item_id',
|
||||||
@@ -167,7 +169,7 @@ export default class ChangeModel extends BaseModel<Change> {
|
|||||||
userId,
|
userId,
|
||||||
];
|
];
|
||||||
|
|
||||||
if (!doCountQuery) subParams1.push(limit);
|
if (!doCountQuery) subParams1.push(subQueryLimit);
|
||||||
|
|
||||||
const subQuery2 = `
|
const subQuery2 = `
|
||||||
SELECT ${fieldsSql}
|
SELECT ${fieldsSql}
|
||||||
@@ -185,7 +187,7 @@ export default class ChangeModel extends BaseModel<Change> {
|
|||||||
userId,
|
userId,
|
||||||
];
|
];
|
||||||
|
|
||||||
if (!doCountQuery) subParams2.push(limit);
|
if (!doCountQuery) subParams2.push(subQueryLimit);
|
||||||
|
|
||||||
let query: Knex.Raw<any> = null;
|
let query: Knex.Raw<any> = null;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user