Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
sagemathinc
GitHub Repository: sagemathinc/cocalc
Path: blob/master/src/packages/project/project-info/project-info.ts
1447 views
1
/*
2
* This file is part of CoCalc: Copyright © 2020 Sagemath, Inc.
3
* License: MS-RSL – see LICENSE.md for details
4
*/
5
6
/*
7
Project information
8
*/
9
10
import { ProjectInfoServer } from "./server";
11
import { createService } from "@cocalc/conat/project/project-info";
12
import { project_id, compute_server_id } from "@cocalc/project/data";
13
14
// singleton, we instantiate it when we need it
15
let info: ProjectInfoServer | null = null;
16
let service: any = null;
17
18
export function get_ProjectInfoServer(): ProjectInfoServer {
19
if (info != null) {
20
return info;
21
}
22
info = new ProjectInfoServer();
23
service = createService({ infoServer: info, project_id, compute_server_id });
24
25
return info;
26
}
27
28
export function close() {
29
service?.close();
30
info?.close();
31
info = service = null;
32
}
33
34