From cbded5f4e9099ed8a20ca5832b5d7d1ecc835306 Mon Sep 17 00:00:00 2001 From: J H <2364004+Blu-J@users.noreply.github.com> Date: Tue, 30 Jan 2024 15:50:09 -0700 Subject: [PATCH] wip" --- lib/dependency/mountDependencies.ts | 4 +--- lib/mainFn/Daemons.ts | 9 ++------- lib/types.ts | 10 +++------- lib/util/utils.ts | 3 +-- 4 files changed, 7 insertions(+), 19 deletions(-) diff --git a/lib/dependency/mountDependencies.ts b/lib/dependency/mountDependencies.ts index de22932..31f9cda 100644 --- a/lib/dependency/mountDependencies.ts +++ b/lib/dependency/mountDependencies.ts @@ -25,9 +25,7 @@ export async function mountDependencies< const mountPath = `${value.manifestId}/${value.volume}/${value.name}` return (await effects.mount({ - location: { - path: mountPath, - }, + location: mountPath, target: { packageId: value.manifestId, path: value.path, diff --git a/lib/mainFn/Daemons.ts b/lib/mainFn/Daemons.ts index ce10ead..4e8ba7b 100644 --- a/lib/mainFn/Daemons.ts +++ b/lib/mainFn/Daemons.ts @@ -3,12 +3,7 @@ import { CheckResult } from "../health/checkFns" import { Trigger } from "../trigger" import { TriggerInput } from "../trigger/TriggerInput" import { defaultTrigger } from "../trigger/defaultTrigger" -import { - DaemonReturned, - Effects, - Signals, - ValidIfNoStupidEscape, -} from "../types" +import { DaemonReturned, Effects, ValidIfNoStupidEscape } from "../types" import { createUtils } from "../util" type Daemon = { id: "" extends Id ? never : Id @@ -133,7 +128,7 @@ export class Daemons { }) } return { - async term(options?: { signal?: Signals; timeout?: number }) { + async term(options?: { signal?: string; timeout?: number }) { await Promise.all( Object.values>(daemonsStarted).map((x) => x.then((x) => x.term(options)), diff --git a/lib/types.ts b/lib/types.ts index ea200e4..eef314a 100644 --- a/lib/types.ts +++ b/lib/types.ts @@ -380,14 +380,14 @@ export type Effects = { * @returns PEM encoded fullchain (ecdsa) */ getSslCertificate: ( - packageId: string, + packageId?: string, algorithm?: "ecdsa" | "ed25519", ) => Promise<[string, string, string]> /** * @returns PEM encoded ssl key (ecdsa) */ getSslKey: ( - packageId: string, + packageId?: string, algorithm?: "ecdsa" | "ed25519", ) => Promise @@ -427,11 +427,7 @@ export type Effects = { shutdown(): void mount(options: { - location: { - /** If there is no volumeId then we mount to runMedia a special mounting location */ - volumeId?: string - path: string - } + location: string target: { packageId: string volumeId: string diff --git a/lib/util/utils.ts b/lib/util/utils.ts index 61d056d..0cc5a5f 100644 --- a/lib/util/utils.ts +++ b/lib/util/utils.ts @@ -11,7 +11,6 @@ import { ExtractStore, InterfaceId, PackageId, - Signals, ValidIfNoStupidEscape, } from "../types" import { GetSystemSmtp } from "./GetSystemSmtp" @@ -38,7 +37,7 @@ import { import * as CP from "node:child_process" import { promisify } from "node:util" import { splitCommand } from "./splitCommand" - +export type Signals = "SIGTERM" | "SIGKILL" export const SIGTERM: Signals = "SIGTERM" export const SIGKILL: Signals = "SIGTERM" export const NO_TIMEOUT = -1