mirror of
https://github.com/pockethost/pockethost.git
synced 2025-06-06 06:06:45 +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,
|
||||
coreInternalUrl: url,
|
||||
})
|
||||
const backupService = await createBackupService(client, rpcService)
|
||||
const backupService = await createBackupService(rpcService)
|
||||
|
||||
info(`Hooking into process exit event`)
|
||||
|
||||
|
@ -13,15 +13,13 @@ import {
|
||||
RpcCommands,
|
||||
} from '@pockethost/common'
|
||||
import Bottleneck from 'bottleneck'
|
||||
import { PocketbaseClientApi } from '../db/PbClient'
|
||||
import { clientService } from '../db/PbClient'
|
||||
import { backupInstance } from '../util/backupInstance'
|
||||
import { RpcServiceApi } from './RpcService'
|
||||
|
||||
export const createBackupService = async (
|
||||
client: PocketbaseClientApi,
|
||||
jobService: RpcServiceApi
|
||||
) => {
|
||||
export const createBackupService = async (jobService: RpcServiceApi) => {
|
||||
const { dbg } = logger().create('BackupService')
|
||||
const client = await clientService()
|
||||
|
||||
jobService.registerCommand<BackupInstancePayload, BackupInstanceResult>(
|
||||
RpcCommands.BackupInstance,
|
||||
|
Loading…
x
Reference in New Issue
Block a user