update: proxies that can be used to snapshot
This commit is contained in:
parent
7ac2d2c217
commit
8721089e7c
@ -282,6 +282,7 @@ class NetScheduler {
|
|||||||
return JSON.parse(JSON.parse(rawData.body)) as R;
|
return JSON.parse(JSON.parse(rawData.body)) as R;
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
logger.error(e, "net", "alicloudFcRequest");
|
||||||
throw new NetSchedulerError(`Unhandled error: Cannot proxy ${url} to ali-fc.`, "ALICLOUD_PROXY_ERR", e);
|
throw new NetSchedulerError(`Unhandled error: Cannot proxy ${url} to ali-fc.`, "ALICLOUD_PROXY_ERR", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -347,13 +348,14 @@ The order of setTaskLimiter and setProviderLimiter relative to each other is fle
|
|||||||
but both should come after addProxy and addTask to ensure proper setup and dependencies are met.
|
but both should come after addProxy and addTask to ensure proper setup and dependencies are met.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
const regions = ["shanghai", "hangzhou", "qingdao", "beijing", "zhangjiakou", "chengdu", "shenzhen", "hohhot"];
|
||||||
netScheduler.addProxy("native", "native", "");
|
netScheduler.addProxy("native", "native", "");
|
||||||
for (const region of ["shanghai", "hangzhou", "qingdao", "beijing", "zhangjiakou", "chengdu", "shenzhen", "hohhot"]) {
|
for (const region of regions) {
|
||||||
netScheduler.addProxy(`alicloud-${region}`, "alicloud-fc", region);
|
netScheduler.addProxy(`alicloud-${region}`, "alicloud-fc", region);
|
||||||
}
|
}
|
||||||
netScheduler.addTask("getVideoInfo", "bilibili", ["native"]);
|
netScheduler.addTask("getVideoInfo", "bilibili", ["native"]);
|
||||||
netScheduler.addTask("getLatestVideos", "bilibili", ["native"]);
|
netScheduler.addTask("getLatestVideos", "bilibili", ["native"]);
|
||||||
netScheduler.addTask("snapshotMilestoneVideo", "bilibili", "all");
|
netScheduler.addTask("snapshotMilestoneVideo", "bilibili", regions.map((region) => `alicloud-${region}`));
|
||||||
netScheduler.addTask("snapshotVideo", "bilibili", [
|
netScheduler.addTask("snapshotVideo", "bilibili", [
|
||||||
"alicloud-qingdao",
|
"alicloud-qingdao",
|
||||||
"alicloud-shanghai",
|
"alicloud-shanghai",
|
||||||
|
@ -7,7 +7,7 @@ export async function getVideoDetails(aid: number): Promise<VideoDetailsData | n
|
|||||||
const data = await netScheduler.request<VideoDetailsResponse>(url, "getVideoInfo");
|
const data = await netScheduler.request<VideoDetailsResponse>(url, "getVideoInfo");
|
||||||
const errMessage = `Error fetching metadata for ${aid}:`;
|
const errMessage = `Error fetching metadata for ${aid}:`;
|
||||||
if (data.code !== 0) {
|
if (data.code !== 0) {
|
||||||
logger.error(errMessage + data.message, "net", "fn:getVideoInfo");
|
logger.error(errMessage + data.code + "-" + data.message, "net", "fn:getVideoInfo");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return data.data;
|
return data.data;
|
||||||
|
@ -7,7 +7,7 @@ export async function getVideoInfo(aid: number, task: string): Promise<VideoInfo
|
|||||||
const data = await netScheduler.request<VideoInfoResponse>(url, task);
|
const data = await netScheduler.request<VideoInfoResponse>(url, task);
|
||||||
const errMessage = `Error fetching metadata for ${aid}:`;
|
const errMessage = `Error fetching metadata for ${aid}:`;
|
||||||
if (data.code !== 0) {
|
if (data.code !== 0) {
|
||||||
logger.error(errMessage + data.message, "net", "fn:getVideoInfo");
|
logger.error(errMessage + data.code + "-" + data.message, "net", "fn:getVideoInfo");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return data.data;
|
return data.data;
|
||||||
|
Loading…
Reference in New Issue
Block a user