mirror of
https://github.com/anomalyco/opencode.git
synced 2026-04-25 07:15:19 +00:00
tui: add reload functionality and improve lazy utility with reset capability
This commit is contained in:
@@ -6,6 +6,7 @@ import { InstanceBootstrap } from "@/project/bootstrap"
|
||||
import { Rpc } from "@/util/rpc"
|
||||
import { upgrade } from "@/cli/upgrade"
|
||||
import type { BunWebSocketData } from "hono/bun"
|
||||
import { Config } from "@/config/config"
|
||||
|
||||
await Log.init({
|
||||
print: process.argv.includes("--print-logs"),
|
||||
@@ -51,6 +52,10 @@ export const rpc = {
|
||||
},
|
||||
})
|
||||
},
|
||||
async reload() {
|
||||
Config.global.reset()
|
||||
await Instance.disposeAll()
|
||||
},
|
||||
async shutdown() {
|
||||
Log.Default.info("worker shutting down")
|
||||
await Instance.disposeAll()
|
||||
|
||||
Reference in New Issue
Block a user