owlservable 0.2.3 → 0.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dashboard.html CHANGED
@@ -303,6 +303,7 @@ document.getElementById('btn-clear').addEventListener('click',function(){
303
303
 
304
304
  function handleMsg(msg){
305
305
  if(msg.type==='init'){
306
+ reset();
306
307
  msg.requests.slice().reverse().forEach(function(r){addRow(r,false);});
307
308
  renderSave(msg.save);
308
309
  }else if(msg.type==='request'){
@@ -344,7 +345,7 @@ function connect(){
344
345
  btnPause.title='Resume ('+pauseBuffer.length+' buffered)';
345
346
  return;
346
347
  }
347
- handleMsg(msg);
348
+ try{handleMsg(msg);}catch(_){}
348
349
  });
349
350
  }
350
351
  connect();
package/index.cjs CHANGED
@@ -317,6 +317,7 @@ function startDashboard(port) {
317
317
  const urlPath = req.url?.split('?')[0] || '/'
318
318
 
319
319
  if (urlPath === '/events') {
320
+ try { req.socket.setNoDelay(true) } catch (_) {}
320
321
  res.writeHead(200, { 'Content-Type': 'text/event-stream', 'Cache-Control': 'no-cache', 'Connection': 'keep-alive' })
321
322
  const send = d => { try { res.write('data: ' + JSON.stringify(d) + '\n\n') } catch (_) {} }
322
323
  send({ type: 'init', requests: getRequests(), save: getSaveInfo() })
@@ -373,6 +374,10 @@ function startDashboard(port) {
373
374
  server.listen(port, '127.0.0.1', () => console.log('[owlservable] Dashboard → http://localhost:' + port))
374
375
  }
375
376
 
377
+ process.on('exit', () => { if (server) server.close() })
378
+ process.on('SIGTERM', () => { if (server) server.close(); process.exit(0) })
379
+ process.on('SIGINT', () => { if (server) server.close(); process.exit(0) })
380
+
376
381
  let initialized = false
377
382
 
378
383
  function init({ port = 4321, dashboard = true, logging = false, save = false, retention = 86_400_000 } = {}) {
package/index.js CHANGED
@@ -317,6 +317,7 @@ function startDashboard(port) {
317
317
  const urlPath = req.url?.split('?')[0] || '/'
318
318
 
319
319
  if (urlPath === '/events') {
320
+ try { req.socket.setNoDelay(true) } catch (_) {}
320
321
  res.writeHead(200, { 'Content-Type': 'text/event-stream', 'Cache-Control': 'no-cache', 'Connection': 'keep-alive' })
321
322
  const send = d => { try { res.write('data: ' + JSON.stringify(d) + '\n\n') } catch (_) {} }
322
323
  send({ type: 'init', requests: getRequests(), save: getSaveInfo() })
@@ -373,6 +374,10 @@ function startDashboard(port) {
373
374
  server.listen(port, '127.0.0.1', () => console.log('[owlservable] Dashboard → http://localhost:' + port))
374
375
  }
375
376
 
377
+ process.on('exit', () => { if (server) server.close() })
378
+ process.on('SIGTERM', () => { if (server) server.close(); process.exit(0) })
379
+ process.on('SIGINT', () => { if (server) server.close(); process.exit(0) })
380
+
376
381
  let initialized = false
377
382
 
378
383
  export function init({ port = 4321, dashboard = true, logging = false, save = false, retention = 86_400_000 } = {}) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "owlservable",
3
- "version": "0.2.3",
3
+ "version": "0.2.5",
4
4
  "description": "Minimalist Observability Platform. Zero config, zero dependencies.",
5
5
  "type": "module",
6
6
  "main": "index.js",