mirror of
https://github.com/anomalyco/opencode.git
synced 2026-11-19 17:01:37 +03:00
refactor(server): inject database options
This commit is contained in:
@@ -65,6 +65,9 @@ const processEffect = Effect.fnUntraced(function* (options: Options) {
|
||||
port: Option.fromNullishOr(port),
|
||||
password,
|
||||
instanceID,
|
||||
database: {
|
||||
path: process.env.OPENCODE_DB,
|
||||
},
|
||||
service:
|
||||
serviceOptions === undefined
|
||||
? undefined
|
||||
|
||||
@@ -511,7 +511,7 @@ test("a failed service stays registered and owns the selected port until stopped
|
||||
}, 30_000)
|
||||
|
||||
function withDatabase<A, E>(file: string, effect: Effect.Effect<A, E, Database.Service>) {
|
||||
return Effect.runPromise(effect.pipe(Effect.provide(Database.layerFromPath(file)), Effect.scoped))
|
||||
return Effect.runPromise(effect.pipe(Effect.provide(Database.layer({ path: file })), Effect.scoped))
|
||||
}
|
||||
|
||||
function waitForExecutionStart(file: string, sessionID: SessionV2.ID) {
|
||||
|
||||
Reference in New Issue
Block a user