debug more
This commit is contained in:
@@ -5,7 +5,7 @@ import env from '@fastify/env';
|
||||
import cookie from '@fastify/cookie';
|
||||
import path, { join } from 'path';
|
||||
import autoLoad from '@fastify/autoload';
|
||||
import { asyncExecShell, isDev, listSettings, prisma, version } from './lib/common';
|
||||
import { asyncExecShell, createRemoteEngineConfiguration, isDev, listSettings, prisma, version } from './lib/common';
|
||||
import { scheduler } from './lib/scheduler';
|
||||
import { compareVersions } from 'compare-versions';
|
||||
import Graceful from '@ladjs/graceful'
|
||||
@@ -136,10 +136,14 @@ fastify.listen({ port, host }, async (err: any, address: any) => {
|
||||
// scheduler.workers.has('infrastructure') && scheduler.workers.get('infrastructure').postMessage("action:cleanupPrismaEngines")
|
||||
// }, 60000)
|
||||
|
||||
await getArch();
|
||||
await getIPAddress();
|
||||
await Promise.all([
|
||||
getArch(),
|
||||
getIPAddress(),
|
||||
// configureRemoteDockers(),
|
||||
])
|
||||
});
|
||||
async function getIPAddress() {
|
||||
console.log('getIPAddress')
|
||||
const { publicIpv4, publicIpv6 } = await import('public-ip')
|
||||
try {
|
||||
const settings = await listSettings();
|
||||
@@ -167,6 +171,7 @@ async function initServer() {
|
||||
} catch (error) { }
|
||||
}
|
||||
async function getArch() {
|
||||
console.log('getArch')
|
||||
try {
|
||||
const settings = await prisma.setting.findFirst({})
|
||||
if (settings && !settings.arch) {
|
||||
@@ -176,3 +181,19 @@ async function getArch() {
|
||||
}
|
||||
|
||||
|
||||
|
||||
async function configureRemoteDockers() {
|
||||
console.log('configureRemoteDockers')
|
||||
try {
|
||||
const remoteDocker = await prisma.destinationDocker.findMany({
|
||||
where: { remoteVerified: true, remoteEngine: true }
|
||||
});
|
||||
if (remoteDocker.length > 0) {
|
||||
for (const docker of remoteDocker) {
|
||||
await createRemoteEngineConfiguration(docker.id)
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user