CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
sagemathinc

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

GitHub Repository: sagemathinc/cocalc
Path: blob/master/src/packages/database/consts.ts
Views: 687
1
/*
2
* This file is part of CoCalc: Copyright © 2022 Sagemath, Inc.
3
* License: MS-RSL – see LICENSE.md for details
4
*/
5
6
// Constants related to the database.
7
8
import getLogger from "@cocalc/backend/logger";
9
const L = getLogger("db:consts");
10
11
/**
12
* this is a limit for each query, unless timeout_s is specified.
13
* https://postgresqlco.nf/en/doc/param/statement_timeout/
14
*/
15
export const STATEMENT_TIMEOUT_MS =
16
1000 *
17
(process.env.PG_STATEMENT_TIMEOUT_S
18
? parseInt(process.env.PG_STATEMENT_TIMEOUT_S)
19
: 30);
20
21
L.debug(`STATEMENT_TIMEOUT_MS=${STATEMENT_TIMEOUT_MS}ms`);
22
23