mirror of https://codeberg.org/pzp/pzp-sync.git
remove goal "oldest"
This commit is contained in:
parent
4637a24960
commit
20be886872
|
@ -79,17 +79,6 @@ class Algorithm {
|
||||||
return [minWant, maxWant]
|
return [minWant, maxWant]
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param {Range} localHaveRange
|
|
||||||
* @param {Range} remoteHaveRange
|
|
||||||
* @param {number} count
|
|
||||||
* @returns {Range}
|
|
||||||
*/
|
|
||||||
#wantOldestRange(localHaveRange, remoteHaveRange, count) {
|
|
||||||
// TODO: implement
|
|
||||||
throw new Error('not implemented')
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Range} localHave
|
* @param {Range} localHave
|
||||||
* @param {Range} remoteHave
|
* @param {Range} remoteHave
|
||||||
|
@ -103,8 +92,6 @@ class Algorithm {
|
||||||
return this.#wantAllRange(localHave, remoteHave)
|
return this.#wantAllRange(localHave, remoteHave)
|
||||||
} else if (goal.type === 'newest') {
|
} else if (goal.type === 'newest') {
|
||||||
return this.#wantNewestRange(localHave, remoteHave, goal.count)
|
return this.#wantNewestRange(localHave, remoteHave, goal.count)
|
||||||
} else if (goal.type === 'oldest') {
|
|
||||||
return this.#wantOldestRange(localHave, remoteHave, goal.count)
|
|
||||||
}
|
}
|
||||||
return EMPTY_RANGE
|
return EMPTY_RANGE
|
||||||
}
|
}
|
||||||
|
@ -249,9 +236,6 @@ class Algorithm {
|
||||||
if (goal.type === 'newest') {
|
if (goal.type === 'newest') {
|
||||||
return await this.pruneNewest(rootID, goal.count)
|
return await this.pruneNewest(rootID, goal.count)
|
||||||
}
|
}
|
||||||
if (goal.type === 'oldest') {
|
|
||||||
throw new Error('not implemented') // TODO
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -7,11 +7,7 @@ const { isEmptyRange } = require('./range')
|
||||||
* @typedef {import('ppppp-db/msg-v3').Msg} Msg
|
* @typedef {import('ppppp-db/msg-v3').Msg} Msg
|
||||||
* @typedef {import('./range').Range} Range
|
* @typedef {import('./range').Range} Range
|
||||||
* @typedef {import('./algorithm')} Algorithm
|
* @typedef {import('./algorithm')} Algorithm
|
||||||
* @typedef {{
|
* @typedef {import('ppppp-goals').Goal} Goal
|
||||||
* type: 'all' | 'newest' | 'oldest',
|
|
||||||
* count: number,
|
|
||||||
* id: string
|
|
||||||
* }} Goal
|
|
||||||
* @typedef {string} MsgID
|
* @typedef {string} MsgID
|
||||||
* @typedef {{id: string}} WithId
|
* @typedef {{id: string}} WithId
|
||||||
* @typedef {WithId & {phase: 0, payload?: undefined}} Data0
|
* @typedef {WithId & {phase: 0, payload?: undefined}} Data0
|
||||||
|
|
Loading…
Reference in New Issue