diff options
author | Sam Wilkins <samwilkins333@gmail.com> | 2020-04-03 17:37:36 -0700 |
---|---|---|
committer | Sam Wilkins <samwilkins333@gmail.com> | 2020-04-03 17:37:36 -0700 |
commit | 3949f6a094f835e495562ab5484b23ade3d1003f (patch) | |
tree | 046fc263c6ffad43c90d5236e3fa343870e5b1b6 /src | |
parent | 5414cc78dfb650954c9b6fef8115a5945ea8d6a6 (diff) |
restored session manager content, things compile and seem to run fine
Diffstat (limited to 'src')
-rw-r--r-- | src/server/ApiManagers/SessionManager.ts | 20 | ||||
-rw-r--r-- | src/server/index.ts | 4 |
2 files changed, 12 insertions, 12 deletions
diff --git a/src/server/ApiManagers/SessionManager.ts b/src/server/ApiManagers/SessionManager.ts index c993c985f..bcaa6598f 100644 --- a/src/server/ApiManagers/SessionManager.ts +++ b/src/server/ApiManagers/SessionManager.ts @@ -2,7 +2,7 @@ import ApiManager, { Registration } from "./ApiManager"; import { Method, _permission_denied, AuthorizedCore, SecureHandler } from "../RouteManager"; import RouteSubscriber from "../RouteSubscriber"; import { sessionAgent } from ".."; -// import { DashSessionAgent } from "../DashSession/DashSessionAgent"; +import { DashSessionAgent } from "../DashSession/DashSessionAgent"; const permissionError = "You are not authorized!"; @@ -25,15 +25,15 @@ export default class SessionManager extends ApiManager { protected initialize(register: Registration): void { - // register({ - // method: Method.GET, - // subscription: this.secureSubscriber("debug", "to?"), - // secureHandler: this.authorizedAction(async ({ req: { params }, res }) => { - // const to = params.to || DashSessionAgent.notificationRecipient; - // const { error } = await sessionAgent.serverWorker.emit("debug", { to }); - // res.send(error ? error.message : `Your request was successful: the server captured and compressed (but did not save) a new back up. It was sent to ${to}.`); - // }) - // }); + register({ + method: Method.GET, + subscription: this.secureSubscriber("debug", "to?"), + secureHandler: this.authorizedAction(async ({ req: { params }, res }) => { + const to = params.to || DashSessionAgent.notificationRecipient; + const { error } = await sessionAgent.serverWorker.emit("debug", { to }); + res.send(error ? error.message : `Your request was successful: the server captured and compressed (but did not save) a new back up. It was sent to ${to}.`); + }) + }); register({ method: Method.GET, diff --git a/src/server/index.ts b/src/server/index.ts index 8325f5d44..97f70630b 100644 --- a/src/server/index.ts +++ b/src/server/index.ts @@ -22,7 +22,7 @@ import GeneralGoogleManager from "./ApiManagers/GeneralGoogleManager"; import GooglePhotosManager from "./ApiManagers/GooglePhotosManager"; import { Logger } from "./ProcessFactory"; import { yellow } from "colors"; -// import { DashSessionAgent } from "./DashSession/DashSessionAgent"; +import { DashSessionAgent } from "./DashSession/DashSessionAgent"; import SessionManager from "./ApiManagers/SessionManager"; import { AppliedSessionAgent } from "./DashSession/Session/agents/applied_session_agent"; import { Utils } from "../Utils"; @@ -146,7 +146,7 @@ export async function launchServer() { * So, the 'else' clause is exactly what we've always run when executing npm start. */ if (process.env.RELEASE) { - // (sessionAgent = new DashSessionAgent()).launch(); + (sessionAgent = new DashSessionAgent()).launch(); } else { launchServer(); } |