MCPcopy
hub / github.com/subnub/myDrive / waitForDatabase

Function waitForDatabase

serverUtils/createVideoThumbnails.js:11–26  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

9const getKey = require("../dist-backend/key/get-key").default;
10
11const waitForDatabase = () => {
12 return new Promise((resolve, reject) => {
13 // Wait for the database to be ready.
14 const timeoutWait = () => {
15 setTimeout(() => resolve(), 3000);
16 };
17
18 if (conn.readyState !== 1) {
19 conn.once("open", () => {
20 timeoutWait();
21 });
22 } else {
23 timeoutWait();
24 }
25 });
26};
27
28// Wait to be after anything else may be printed to the terminal
29const terminalWait = () => {

Callers 1

updateDocsFunction · 0.70

Calls 1

timeoutWaitFunction · 0.85

Tested by

no test coverage detected