mirror of
https://github.com/imputnet/cobalt.git
synced 2025-07-13 08:48:26 +00:00
Merge branch 'main' into reddit-short-link
This commit is contained in:
commit
51b1b7f373
@ -1,8 +1,11 @@
|
||||
import * as cluster from "../../misc/cluster.js";
|
||||
|
||||
import { Agent } from "undici";
|
||||
import { env } from "../../config.js";
|
||||
import { Green, Yellow } from "../../misc/console-text.js";
|
||||
|
||||
const defaultAgent = new Agent();
|
||||
|
||||
let session;
|
||||
|
||||
const validateSession = (sessionResponse) => {
|
||||
@ -32,7 +35,11 @@ const loadSession = async () => {
|
||||
const sessionServerUrl = new URL(env.ytSessionServer);
|
||||
sessionServerUrl.pathname = "/token";
|
||||
|
||||
const newSession = await fetch(sessionServerUrl).then(a => a.json());
|
||||
const newSession = await fetch(
|
||||
sessionServerUrl,
|
||||
{ dispatcher: defaultAgent }
|
||||
).then(a => a.json());
|
||||
|
||||
validateSession(newSession);
|
||||
|
||||
if (!session || session.updated < newSession?.updated) {
|
||||
|
@ -49,6 +49,5 @@ services:
|
||||
# init: true
|
||||
# restart: unless-stopped
|
||||
# container_name: yt-session-generator
|
||||
|
||||
# ports:
|
||||
# - 127.0.0.1:1280:8080
|
||||
# labels:
|
||||
# - com.centurylinklabs.watchtower.scope=cobalt
|
||||
|
Loading…
Reference in New Issue
Block a user