refactor: unwrap Heap namespace + self-reexport (#22931)
This commit is contained in:
@@ -8,12 +8,11 @@ const log = Log.create({ service: "heap" })
|
|||||||
const MINUTE = 60_000
|
const MINUTE = 60_000
|
||||||
const LIMIT = 2 * 1024 * 1024 * 1024
|
const LIMIT = 2 * 1024 * 1024 * 1024
|
||||||
|
|
||||||
export namespace Heap {
|
let timer: Timer | undefined
|
||||||
let timer: Timer | undefined
|
let lock = false
|
||||||
let lock = false
|
let armed = true
|
||||||
let armed = true
|
|
||||||
|
|
||||||
export function start() {
|
export function start() {
|
||||||
if (!Flag.OPENCODE_AUTO_HEAP_SNAPSHOT) return
|
if (!Flag.OPENCODE_AUTO_HEAP_SNAPSHOT) return
|
||||||
if (timer) return
|
if (timer) return
|
||||||
|
|
||||||
@@ -55,5 +54,6 @@ export namespace Heap {
|
|||||||
void run()
|
void run()
|
||||||
}, MINUTE)
|
}, MINUTE)
|
||||||
timer.unref?.()
|
timer.unref?.()
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export * as Heap from "./heap"
|
||||||
|
|||||||
Reference in New Issue
Block a user