mirror of
https://github.com/pockethost/pockethost.git
synced 2025-06-06 14:16:41 +00:00
chore: refactor client from rpcService
This commit is contained in:
parent
9afabf9067
commit
31abcb7a21
@ -35,7 +35,7 @@ global.EventSource = require('eventsource')
|
||||
const client = await clientService(url)
|
||||
|
||||
ftpService({})
|
||||
const rpcService = await createRpcService({ client })
|
||||
const rpcService = await createRpcService({})
|
||||
const instanceService = await createInstanceService({ client, rpcService })
|
||||
const proxyService = await createProxyService({
|
||||
instanceManager: instanceService,
|
||||
|
@ -12,7 +12,7 @@ import Bottleneck from 'bottleneck'
|
||||
import { default as knexFactory } from 'knex'
|
||||
import pocketbaseEs from 'pocketbase'
|
||||
import { AsyncReturnType, JsonObject } from 'type-fest'
|
||||
import { PocketbaseClientApi } from '../db/PbClient'
|
||||
import { clientService } from '../db/PbClient'
|
||||
|
||||
export type RpcServiceApi = AsyncReturnType<typeof createRpcService>
|
||||
|
||||
@ -28,12 +28,11 @@ export type RpcRunner<
|
||||
TResult extends JsonObject
|
||||
> = (job: RpcFields<TPayload, TResult>) => Promise<TResult>
|
||||
|
||||
export type RpcServiceConfig = { client: PocketbaseClientApi }
|
||||
export type RpcServiceConfig = {}
|
||||
|
||||
export const createRpcService = async (config: RpcServiceConfig) => {
|
||||
const { dbg, error } = logger().create('RpcService')
|
||||
|
||||
const { client } = config
|
||||
const client = await clientService()
|
||||
|
||||
const limiter = new Bottleneck({ maxConcurrent: 1 })
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user