ScuttleBot
| f7eb47b… | lmata | 1 | "use strict"; |
| f7eb47b… | lmata | 2 | var __defProp = Object.defineProperty; |
| f7eb47b… | lmata | 3 | var __getOwnPropDesc = Object.getOwnPropertyDescriptor; |
| f7eb47b… | lmata | 4 | var __getOwnPropNames = Object.getOwnPropertyNames; |
| f7eb47b… | lmata | 5 | var __hasOwnProp = Object.prototype.hasOwnProperty; |
| f7eb47b… | lmata | 6 | var __export = (target, all) => { |
| f7eb47b… | lmata | 7 | for (var name in all) |
| f7eb47b… | lmata | 8 | __defProp(target, name, { get: all[name], enumerable: true }); |
| f7eb47b… | lmata | 9 | }; |
| f7eb47b… | lmata | 10 | var __copyProps = (to, from, except, desc) => { |
| f7eb47b… | lmata | 11 | if (from && typeof from === "object" || typeof from === "function") { |
| f7eb47b… | lmata | 12 | for (let key of __getOwnPropNames(from)) |
| f7eb47b… | lmata | 13 | if (!__hasOwnProp.call(to, key) && key !== except) |
| f7eb47b… | lmata | 14 | __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); |
| f7eb47b… | lmata | 15 | } |
| f7eb47b… | lmata | 16 | return to; |
| f7eb47b… | lmata | 17 | }; |
| f7eb47b… | lmata | 18 | var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); |
| f7eb47b… | lmata | 19 | var watchdog_exports = {}; |
| f7eb47b… | lmata | 20 | __export(watchdog_exports, { |
| f7eb47b… | lmata | 21 | setupExitWatchdog: () => setupExitWatchdog |
| f7eb47b… | lmata | 22 | }); |
| f7eb47b… | lmata | 23 | module.exports = __toCommonJS(watchdog_exports); |
| f7eb47b… | lmata | 24 | var import_browserContextFactory = require("./browserContextFactory"); |
| f7eb47b… | lmata | 25 | var import_context = require("./context"); |
| f7eb47b… | lmata | 26 | function setupExitWatchdog() { |
| f7eb47b… | lmata | 27 | let isExiting = false; |
| f7eb47b… | lmata | 28 | const handleExit = async () => { |
| f7eb47b… | lmata | 29 | if (isExiting) |
| f7eb47b… | lmata | 30 | return; |
| f7eb47b… | lmata | 31 | isExiting = true; |
| f7eb47b… | lmata | 32 | setTimeout(() => process.exit(0), 15e3); |
| f7eb47b… | lmata | 33 | await import_context.Context.disposeAll(); |
| f7eb47b… | lmata | 34 | await import_browserContextFactory.SharedContextFactory.dispose(); |
| f7eb47b… | lmata | 35 | process.exit(0); |
| f7eb47b… | lmata | 36 | }; |
| f7eb47b… | lmata | 37 | process.stdin.on("close", handleExit); |
| f7eb47b… | lmata | 38 | process.on("SIGINT", handleExit); |
| f7eb47b… | lmata | 39 | process.on("SIGTERM", handleExit); |
| f7eb47b… | lmata | 40 | } |
| f7eb47b… | lmata | 41 | // Annotate the CommonJS export names for ESM import in node: |
| f7eb47b… | lmata | 42 | 0 && (module.exports = { |
| f7eb47b… | lmata | 43 | setupExitWatchdog |
| f7eb47b… | lmata | 44 | }); |