I do not like deno.cron
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 53s

This commit is contained in:
Fijxu 2024-12-15 23:31:15 -03:00
parent ea0823a9ea
commit d631aada71
Signed by: Fijxu
GPG key ID: 32C1DDF333EDA6A4

View file

@ -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) => {