Skip to content

Commit

Permalink
troubleshooting prod disconnects
Browse files Browse the repository at this point in the history
  • Loading branch information
iznaut committed Nov 7, 2024
1 parent 11c112c commit b1ffd3e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 32 deletions.
33 changes: 1 addition & 32 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,11 @@ require('dotenv').config()

const os = require("os")

// const pg = require('pg');
// const { Client } = pg
const db = require('./db');

const { Node: Logtail } = require("@logtail/js");
const logtail = new Logtail(process.env.LOGTAIL_TOKEN);

const subdomain = require('express-subdomain');
const express = require('express');
const path = require('path');
const { createServer } = require('http');
Expand Down Expand Up @@ -131,34 +128,6 @@ app.get('/get_random_gif', async (req, res) => {
}
});

var router = express.Router();

router.get('/', function (req, res) {
res.redirect('public/puzzlescript-ws/');
});

app.use(subdomain('puzzlescript', router));

// app.get('/progress', async (req, res) => {
// try {
// console.log(req.query.nquid)

// const result = await db.query(`
// SELECT
// e.dream_id
// FROM
// events e
// where
// e.device_uid = $1
// and e.type = 'handshake'
// `, [req.query.nquid]);
// res.json(result.rows);
// } catch (err) {
// console.error(err);
// res.status(500).send('Internal Server Error');
// }
// });

logtail.debug({ msg: "SERVER UP" })
logtail.flush()

Expand Down Expand Up @@ -302,7 +271,7 @@ server.on('connection', function (client) {
})

client.on('close', function () {
client.log_info('client disconnected')
client.log_info('client disconnected', client)

if (client == uniqueConns.cyberspace) {
uniqueConns.cyberspace = null
Expand Down
1 change: 1 addition & 0 deletions public/PuzzleBit
Submodule PuzzleBit added at 633852

0 comments on commit b1ffd3e

Please sign in to comment.