From 489931eaa809bf4b0997c86f2da2dd38f86d3f0f Mon Sep 17 00:00:00 2001 From: Chewing_Bever Date: Fri, 16 Dec 2022 11:37:51 +0100 Subject: [PATCH] fix: don't buffer stdout even if not a terminal --- Dockerfile | 1 + src/main.v | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/Dockerfile b/Dockerfile index 210ae66..a27ad44 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,6 +23,7 @@ RUN if [ -n "${CI_COMMIT_SHA}" ]; then \ "https://s3.rustybever.be/vieter/commits/${CI_COMMIT_SHA}/vieter-$(echo "${TARGETPLATFORM}" | sed 's:/:-:g')" && \ chmod +x vieter ; \ else \ + cd src && v install && cd .. && \ LDFLAGS='-lz -lbz2 -llzma -lexpat -lzstd -llz4 -lsqlite3 -static' make prod && \ mv pvieter vieter ; \ fi diff --git a/src/main.v b/src/main.v index 34387bf..fe0364f 100644 --- a/src/main.v +++ b/src/main.v @@ -12,6 +12,11 @@ import cron import agent fn main() { + // Stop buffering output so logs always show up immediately + unsafe { + C.setbuf(C.stdout, 0) + } + mut app := cli.Command{ name: 'vieter' description: 'Vieter is a lightweight implementation of an Arch repository server.'