I do not like deno.cron
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 53s
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 53s
This commit is contained in:
parent
ea0823a9ea
commit
d631aada71
1 changed files with 7 additions and 4 deletions
11
src/main.ts
11
src/main.ts
|
@ -65,16 +65,19 @@ if (!innertubeClientOauthEnabled) {
|
|||
innertubeClientCache as UniversalCache,
|
||||
);
|
||||
}
|
||||
Deno.cron(
|
||||
"regenerate youtube session",
|
||||
konfigStore.get("jobs.youtube_session.frequency") as string,
|
||||
setInterval(
|
||||
async () => {
|
||||
const currentDateTime = new Date();
|
||||
console.log("regenrate token called: " + currentDateTime)
|
||||
if (innertubeClientJobPoTokenEnabled) {
|
||||
innertubeClient = await poTokenGenerate(
|
||||
innertubeClient,
|
||||
konfigStore,
|
||||
innertubeClientCache,
|
||||
);
|
||||
const currentDateTimexd = new Date();
|
||||
console.log("regenerate token finished: " + currentDateTimexd)
|
||||
console.log("po_token: " + innertubeClient.session.po_token)
|
||||
} else {
|
||||
innertubeClient = await Innertube.create({
|
||||
cache: innertubeClientCache,
|
||||
|
@ -82,7 +85,7 @@ if (!innertubeClientOauthEnabled) {
|
|||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
konfigStore.get("jobs.youtube_session.frequency_seconds") as number * 1000 || 50000);
|
||||
} else if (innertubeClientOauthEnabled) {
|
||||
// Fired when waiting for the user to authorize the sign in attempt.
|
||||
innertubeClient.session.on("auth-pending", (data) => {
|
||||
|
|
Loading…
Reference in a new issue