Class: Runners::Docker::FetchLogs

Inherits:
Object
  • Object
show all
Defined in:
app/services/runners/docker/fetch_logs.rb

Instance Method Summary collapse

Instance Method Details

#perform(task:) ⇒ Object



6
7
8
9
10
11
12
13
14
15
# File 'app/services/runners/docker/fetch_logs.rb', line 6

def perform(task:)
  # streaming_logs avoids some encoding issues and should be safe since container status = exited
  # (see https://github.com/swipely/docker-api/issues/290 for reference)
  Runners::Docker::FetchTaskContainer
    .new
    .perform(task: task)
    .streaming_logs(stdout: true, stderr: true, tail: 1_000)
rescue ::Docker::Error::NotFoundError => e
  raise Runners::RunnerIdNotFoundError, e.message
end