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
This commit is contained in:
Javi Martín
2021-12-09 19:29:23 +01:00
parent 6d163eb1bf
commit fa56a74ba0

View File

@@ -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.