config fixed, session server timeout increased

This commit is contained in:
C
2023-01-25 17:23:37 +05:00
parent 7efb6a31cb
commit 0c0201622b
4 changed files with 6 additions and 4 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
module.exports = {
port: process.env.PORT,
port: parseInt(process.env.PORT),
database_url: process.env.DATABASE_URL,
database_name: process.env.DATABASE_NAME,
log_path: "./logs/runtime.log",
+1 -1
View File
@@ -28,7 +28,7 @@ const create_session = async (req, res, next) => {
var websocket_url = await run_session(session_server.url, session_id, title)
if (!websocket_url) {
next(new not_found_error('websocket_url not valid'))
next(new not_found_error('can not run session'))
return
}
+1
View File
@@ -11,6 +11,7 @@ const get_db = async () => {
try {
await client.connect()
} catch (err) {
console.log('can not connect to database')
return null
}
return client.db(database_name)
+3 -2
View File
@@ -1,5 +1,6 @@
var request = require('request')
let max_response_timeout = 1000
const max_response_timeout = 1000
const max_run_session_timeout = 10000
const get_fastest_session_server = async (free_servers) => {
var fastest_server = null
@@ -44,7 +45,7 @@ const run_session = async (server_url, session_id, title) => {
var options = {
url: server_url + '/session/run',
method: "POST",
timeout: max_response_timeout,
timeout: max_run_session_timeout,
headers: {
"content-type": "application/json"
},