mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-09 17:33:55 +00:00
feat: add sessions stats endpoint
This commit is contained in:
committed by
Carlos Valente
parent
71c468d069
commit
82810f1cb1
@@ -19,10 +19,13 @@ import { willCauseRegeneration } from '../services/rundown-service/rundownCacheU
|
||||
import { handleLegacyMessageConversion } from './integration.legacy.js';
|
||||
|
||||
const throttledUpdateEvent = throttle(updateEvent, 20);
|
||||
let lastRequest: Date | null = null;
|
||||
|
||||
export function dispatchFromAdapter(type: string, payload: unknown, _source?: 'osc' | 'ws' | 'http') {
|
||||
const action = type.toLowerCase();
|
||||
const handler = actionHandlers[action];
|
||||
lastRequest = new Date();
|
||||
|
||||
if (handler) {
|
||||
return handler(payload);
|
||||
} else {
|
||||
@@ -30,6 +33,10 @@ export function dispatchFromAdapter(type: string, payload: unknown, _source?: 'o
|
||||
}
|
||||
}
|
||||
|
||||
export function getLastRequest() {
|
||||
return lastRequest;
|
||||
}
|
||||
|
||||
type ActionHandler = (payload: unknown) => { payload: unknown };
|
||||
|
||||
const actionHandlers: Record<string, ActionHandler> = {
|
||||
|
||||
Reference in New Issue
Block a user