mirror of
https://github.com/pockethost/pockethost.git
synced 2025-06-06 06:06:45 +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)
|
const client = await clientService(url)
|
||||||
|
|
||||||
ftpService({})
|
ftpService({})
|
||||||
const rpcService = await createRpcService({ client })
|
const rpcService = await createRpcService({})
|
||||||
const instanceService = await createInstanceService({ client, rpcService })
|
const instanceService = await createInstanceService({ client, rpcService })
|
||||||
const proxyService = await createProxyService({
|
const proxyService = await createProxyService({
|
||||||
instanceManager: instanceService,
|
instanceManager: instanceService,
|
||||||
|
@ -12,7 +12,7 @@ import Bottleneck from 'bottleneck'
|
|||||||
import { default as knexFactory } from 'knex'
|
import { default as knexFactory } from 'knex'
|
||||||
import pocketbaseEs from 'pocketbase'
|
import pocketbaseEs from 'pocketbase'
|
||||||
import { AsyncReturnType, JsonObject } from 'type-fest'
|
import { AsyncReturnType, JsonObject } from 'type-fest'
|
||||||
import { PocketbaseClientApi } from '../db/PbClient'
|
import { clientService } from '../db/PbClient'
|
||||||
|
|
||||||
export type RpcServiceApi = AsyncReturnType<typeof createRpcService>
|
export type RpcServiceApi = AsyncReturnType<typeof createRpcService>
|
||||||
|
|
||||||
@ -28,12 +28,11 @@ export type RpcRunner<
|
|||||||
TResult extends JsonObject
|
TResult extends JsonObject
|
||||||
> = (job: RpcFields<TPayload, TResult>) => Promise<TResult>
|
> = (job: RpcFields<TPayload, TResult>) => Promise<TResult>
|
||||||
|
|
||||||
export type RpcServiceConfig = { client: PocketbaseClientApi }
|
export type RpcServiceConfig = {}
|
||||||
|
|
||||||
export const createRpcService = async (config: RpcServiceConfig) => {
|
export const createRpcService = async (config: RpcServiceConfig) => {
|
||||||
const { dbg, error } = logger().create('RpcService')
|
const { dbg, error } = logger().create('RpcService')
|
||||||
|
const client = await clientService()
|
||||||
const { client } = config
|
|
||||||
|
|
||||||
const limiter = new Bottleneck({ maxConcurrent: 1 })
|
const limiter = new Bottleneck({ maxConcurrent: 1 })
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user