update tags + only download on service view

This commit is contained in:
Andras Bacsai
2023-07-20 13:12:54 +02:00
parent e6cbcf98cb
commit 1c0769ad75
4 changed files with 4121 additions and 3604 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -185,14 +185,14 @@ const host = '0.0.0.0';
await checkFluentBit();
}, 60000);
// Refresh and check templates
setInterval(async () => {
await refreshTemplates();
}, 60000 * 10);
// // Refresh and check templates
// setInterval(async () => {
// await refreshTemplates();
// }, 60000 * 10);
setInterval(async () => {
await refreshTags();
}, 60000 * 10);
// setInterval(async () => {
// await refreshTags();
// }, 60000 * 10);
setInterval(
async () => {

View File

@@ -50,6 +50,7 @@ import type {
SetWordpressSettings
} from './types';
import type { OnlyId } from '../../../../types';
import { refreshTags, refreshTemplates } from '../handlers';
export async function listServices(request: FastifyRequest) {
try {
@@ -391,6 +392,13 @@ export async function getService(request: FastifyRequest<OnlyId>) {
}
export async function getServiceType(request: FastifyRequest) {
try {
try {
await refreshTemplates();
await refreshTags();
} catch (error) {
console.log(error)
}
return {
services: await getTemplates()
};