+ ip: req.ip,
+ activityPubMessagesWaiting: InboxManager.Instance.getActivityPubMessagesWaiting()
+ } as Debug)
+}
+
+async function runCommand (req: express.Request, res: express.Response) {
+ const body: SendDebugCommand = req.body
+
+ const processors: { [id in SendDebugCommand['command']]: () => Promise<any> } = {
+ 'remove-dandling-resumable-uploads': () => RemoveDanglingResumableUploadsScheduler.Instance.execute(),
+ 'process-video-views-buffer': () => VideoViewsBufferScheduler.Instance.execute(),
+ 'process-video-viewers': () => VideoViewsManager.Instance.processViewerStats()
+ }
+
+ await processors[body.command]()
+
+ return res.status(HttpStatusCode.NO_CONTENT_204).end()