feat: Query container state periodically

This commit is contained in:
Andras Bacsai
2022-04-20 22:49:24 +02:00
parent 65c8f55ee6
commit e16643c48c
4 changed files with 22 additions and 5 deletions

View File

@@ -21,12 +21,11 @@
<script lang="ts">
import { page } from '$app/stores';
import { changeQueryParams, dateOptions, getDomain } from '$lib/components/common';
import { changeQueryParams, dateOptions } from '$lib/components/common';
import BuildLog from './_BuildLog.svelte';
import { get } from '$lib/api';
import { errorNotification } from '$lib/form';
import { goto } from '$app/navigation';
export let builds;
export let application;

View File

@@ -22,7 +22,9 @@ export const get: RequestHandler = async (event) => {
if (container) {
return {
body: {
logs: (await container.logs({ stdout: true, stderr: true, timestamps: true }))
logs: (
await container.logs({ stdout: true, stderr: true, timestamps: true, tail: 5000 })
)
.toString()
.split('\n')
.map((l) => l.slice(8))