fix: potential shifting for obtained window offset in last commit
This commit is contained in:
parent
d5c278ae06
commit
d6dd4d9334
@ -207,7 +207,7 @@ export async function adjustSnapshotTime(
|
|||||||
let initialOffset = 0;
|
let initialOffset = 0;
|
||||||
|
|
||||||
if (lastAvailableWindow && lastAvailableWindow.count < allowedCounts) {
|
if (lastAvailableWindow && lastAvailableWindow.count < allowedCounts) {
|
||||||
initialOffset = lastAvailableWindow.offset;
|
initialOffset = Math.max(lastAvailableWindow.offset - 2, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
let timePerIteration = 0;
|
let timePerIteration = 0;
|
||||||
|
@ -160,6 +160,7 @@ export const regularSnapshotsWorker = async (_job: Job) => {
|
|||||||
const startedAt = Date.now();
|
const startedAt = Date.now();
|
||||||
if (await lockManager.isLocked("dispatchRegularSnapshots")) {
|
if (await lockManager.isLocked("dispatchRegularSnapshots")) {
|
||||||
logger.log("dispatchRegularSnapshots is already running", "mq");
|
logger.log("dispatchRegularSnapshots is already running", "mq");
|
||||||
|
client.release();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
await lockManager.acquireLock("dispatchRegularSnapshots", 30 * 60);
|
await lockManager.acquireLock("dispatchRegularSnapshots", 30 * 60);
|
||||||
|
18
lib/net/bilibili.d.ts
vendored
18
lib/net/bilibili.d.ts
vendored
@ -9,6 +9,24 @@ export type VideoListResponse = BaseResponse<VideoListData>;
|
|||||||
export type VideoDetailsResponse = BaseResponse<VideoDetailsData>;
|
export type VideoDetailsResponse = BaseResponse<VideoDetailsData>;
|
||||||
export type VideoTagsResponse = BaseResponse<VideoTagsData>;
|
export type VideoTagsResponse = BaseResponse<VideoTagsData>;
|
||||||
export type VideoInfoResponse = BaseResponse<VideoInfoData>;
|
export type VideoInfoResponse = BaseResponse<VideoInfoData>;
|
||||||
|
export type MediaListInfoResponse = BaseResponse<MediaListInfoData>;
|
||||||
|
|
||||||
|
type MediaListInfoData = MediaListInfoItem[];
|
||||||
|
|
||||||
|
|
||||||
|
interface MediaListInfoItem {
|
||||||
|
bvid: string;
|
||||||
|
id: number;
|
||||||
|
cnt_info: {
|
||||||
|
coin: number;
|
||||||
|
collect: number;
|
||||||
|
danmaku: number;
|
||||||
|
play: number;
|
||||||
|
reply: number;
|
||||||
|
share: number;
|
||||||
|
thumb_up: number;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
interface VideoInfoData {
|
interface VideoInfoData {
|
||||||
bvid: string;
|
bvid: string;
|
||||||
|
Loading…
Reference in New Issue
Block a user