mirror of
https://github.com/anomalyco/opencode.git
synced 2026-08-04 13:09:54 +00:00
fix(server): share listener memo map
This commit is contained in:
parent
cf2d1dd3e9
commit
c0d06deefd
1 changed files with 2 additions and 1 deletions
|
|
@ -12,6 +12,7 @@ import { WebSocketTracker } from "./routes/instance/httpapi/websocket-tracker"
|
|||
import { PublicApi } from "./routes/instance/httpapi/public"
|
||||
import type { CorsOptions } from "./cors"
|
||||
import { lazy } from "@/util/lazy"
|
||||
import { memoMap } from "@opencode-ai/core/effect/memo-map"
|
||||
|
||||
// @ts-ignore This global is needed to prevent ai-sdk from logging warnings to stdout https://github.com/vercel/ai/blob/2dc67e0ef538307f21368db32d5a12345d98831b/packages/ai/src/logger/log-warnings.ts#L85
|
||||
globalThis.AI_SDK_LOG_WARNINGS = false
|
||||
|
|
@ -123,7 +124,7 @@ function startWithPortFallback(opts: ListenOptions) {
|
|||
|
||||
function startListener(opts: ListenOptions, port: number) {
|
||||
const scope = Scope.makeUnsafe()
|
||||
return Layer.buildWithMemoMap(listenerLayer(opts, port), Layer.makeMemoMapUnsafe(), scope).pipe(
|
||||
return Layer.buildWithMemoMap(listenerLayer(opts, port), memoMap, scope).pipe(
|
||||
Effect.provide(HttpApiApp.context),
|
||||
Effect.onError(() => Scope.close(scope, Exit.void).pipe(Effect.ignore)),
|
||||
Effect.map(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue