diff options
author | bob <bcz@cs.brown.edu> | 2020-01-31 15:46:44 -0500 |
---|---|---|
committer | bob <bcz@cs.brown.edu> | 2020-01-31 15:46:44 -0500 |
commit | 525c7f768f148514494f7fee44b1e3f357eb2a32 (patch) | |
tree | 3829a9d623710176caad46c73ad70876d18d0679 /src | |
parent | 07e53a4a244eff804e47c6b48b8eb4f2a5096b0e (diff) | |
parent | 7689cc7730a172a901edfca640736f80583a20b5 (diff) |
Merge branch 'master' of https://github.com/browngraphicslab/Dash-Web
Diffstat (limited to 'src')
-rw-r--r-- | src/server/DashSession/DashSessionAgent.ts | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/server/DashSession/DashSessionAgent.ts b/src/server/DashSession/DashSessionAgent.ts index c55e01243..7ecc6ec76 100644 --- a/src/server/DashSession/DashSessionAgent.ts +++ b/src/server/DashSession/DashSessionAgent.ts @@ -25,7 +25,21 @@ export class DashSessionAgent extends AppliedSessionAgent { * The core method invoked when the single master thread is initialized. * Installs event hooks, repl commands and additional IPC listeners. */ - protected async initializeMonitor(monitor: Monitor, sessionKey: string): Promise<void> { + protected async initializeMonitor(monitor: Monitor): Promise<string> { + // ['log', 'warn'].forEach(function (method) { + // const old = (console as any)[method]; + // (console as any)[method] = function () { + // let stack = new Error("").stack?.split(/\n/); + // // Chrome includes a single "Error" line, FF doesn't. + // if (stack && stack[0].indexOf('Error') === 0) { + // stack = stack.slice(1); + // } + // const message = (stack?.[1] || "Stack undefined!").trim(); + // const args = ([] as any[]).slice.apply(arguments).concat([message]); + // return old.apply(console, args); + // }; + // }); + const sessionKey = Utils.GenerateGuid(); await this.dispatchSessionPassword(sessionKey); monitor.addReplCommand("pull", [], () => monitor.exec("git pull")); monitor.addReplCommand("solr", [/start|stop|index/], this.executeSolrCommand); @@ -34,6 +48,7 @@ export class DashSessionAgent extends AppliedSessionAgent { monitor.on("backup", this.backup); monitor.on("debug", async ({ to }) => this.dispatchZippedDebugBackup(to)); monitor.coreHooks.onCrashDetected(this.dispatchCrashReport); + return sessionKey; } /** |