From fa56a74ba0ecf5a43fbb39d588b3c20a0f5a1a45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Thu, 9 Dec 2021 19:29:23 +0100 Subject: [PATCH] Activate sync mode for standard output By default, in order to increase performance during IO operations, Ruby doesn't immediately write to the standard output but uses a buffer internally and writes the output in chunks [1]. It looks like this results in some output being missed when running Docker Compose [2], so we're activating the sync mode, which flushes all output immediately. [1] https://ruby-doc.org/core-2.6.5/IO.html#method-i-sync-3D [2] See issue 1118 in the sinatra/sinatra repository --- config/boot.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/config/boot.rb b/config/boot.rb index 282011619..023130575 100644 --- a/config/boot.rb +++ b/config/boot.rb @@ -1,3 +1,5 @@ +$stdout.sync = true + ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) require "bundler/setup" # Set up gems listed in the Gemfile.