mirror of
https://github.com/Tzahi12345/YoutubeDL-Material.git
synced 2026-03-15 09:10:56 +03:00
Attempted to fix heroku server port
This commit is contained in:
@@ -107,13 +107,13 @@ function File(id, title, thumbnailURL, isAudio, duration, url, uploader, size, p
|
||||
|
||||
// actual functions
|
||||
|
||||
function startServer() {
|
||||
async function startServer() {
|
||||
if (process.env.USING_HEROKU && process.env.PORT) {
|
||||
// default to heroku port if using heroku
|
||||
backendPort = process.env.PORT || backendPort;
|
||||
|
||||
// set config to port
|
||||
config_api.setConfigItem('ytdl_port', backendPort);
|
||||
await setPortItemFromENV();
|
||||
}
|
||||
if (usingEncryption)
|
||||
{
|
||||
@@ -129,6 +129,13 @@ function startServer() {
|
||||
}
|
||||
}
|
||||
|
||||
async function setPortItemFromENV() {
|
||||
return new Promise(resolve => {
|
||||
config_api.setConfigItem('ytdl_port', backendPort.toString());
|
||||
setTimeout(() => resolve(true), 100);
|
||||
});
|
||||
}
|
||||
|
||||
async function setAndLoadConfig() {
|
||||
await setConfigFromEnv();
|
||||
await loadConfig();
|
||||
|
||||
Reference in New Issue
Block a user