feat: add env variable for frequency_seconds

This commit is contained in:
Fijxu 2025-02-03 16:30:11 -03:00
parent 6b83617fcb
commit 9de6fdc399
Signed by: Fijxu
GPG key ID: 32C1DDF333EDA6A4

View file

@ -57,6 +57,10 @@ innertubeClient = await Innertube.create({
cookie: innertubeClientCookies || undefined,
});
const poTokenRefreshInterval = Deno.env.get("FREQUENCY_SECONDS") ||
konfigStore.get("jobs.youtube_session.frequency_seconds");
console.log("[INFO] po_token refresh interval set to", poTokenRefreshInterval);
if (!innertubeClientOauthEnabled) {
if (innertubeClientJobPoTokenEnabled) {
innertubeClient = await poTokenGenerate(
@ -80,8 +84,7 @@ if (!innertubeClientOauthEnabled) {
});
}
},
konfigStore.get("jobs.youtube_session.frequency_seconds") as number *
1000 || 50000,
poTokenRefreshInterval as number * 1000 || 50000,
);
} else if (innertubeClientOauthEnabled) {
// Fired when waiting for the user to authorize the sign in attempt.