mirror of
https://github.com/pockethost/pockethost.git
synced 2025-06-07 14:46:41 +00:00
chore: refactor client from backupService
This commit is contained in:
parent
b09014d0a1
commit
9afabf9067
@ -41,7 +41,7 @@ global.EventSource = require('eventsource')
|
|||||||
instanceManager: instanceService,
|
instanceManager: instanceService,
|
||||||
coreInternalUrl: url,
|
coreInternalUrl: url,
|
||||||
})
|
})
|
||||||
const backupService = await createBackupService(client, rpcService)
|
const backupService = await createBackupService(rpcService)
|
||||||
|
|
||||||
info(`Hooking into process exit event`)
|
info(`Hooking into process exit event`)
|
||||||
|
|
||||||
|
@ -13,15 +13,13 @@ import {
|
|||||||
RpcCommands,
|
RpcCommands,
|
||||||
} from '@pockethost/common'
|
} from '@pockethost/common'
|
||||||
import Bottleneck from 'bottleneck'
|
import Bottleneck from 'bottleneck'
|
||||||
import { PocketbaseClientApi } from '../db/PbClient'
|
import { clientService } from '../db/PbClient'
|
||||||
import { backupInstance } from '../util/backupInstance'
|
import { backupInstance } from '../util/backupInstance'
|
||||||
import { RpcServiceApi } from './RpcService'
|
import { RpcServiceApi } from './RpcService'
|
||||||
|
|
||||||
export const createBackupService = async (
|
export const createBackupService = async (jobService: RpcServiceApi) => {
|
||||||
client: PocketbaseClientApi,
|
|
||||||
jobService: RpcServiceApi
|
|
||||||
) => {
|
|
||||||
const { dbg } = logger().create('BackupService')
|
const { dbg } = logger().create('BackupService')
|
||||||
|
const client = await clientService()
|
||||||
|
|
||||||
jobService.registerCommand<BackupInstancePayload, BackupInstanceResult>(
|
jobService.registerCommand<BackupInstancePayload, BackupInstanceResult>(
|
||||||
RpcCommands.BackupInstance,
|
RpcCommands.BackupInstance,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user