Aggiunge i tornei con hub, pagina pubblica e tabellone per semifinali e finali.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -35,9 +35,9 @@ module Recordings
|
||||
FileUtils.remove_entry(dest)
|
||||
return nil
|
||||
end
|
||||
unless res.is_a?(Net::HTTPSuccess) && res.body.present?
|
||||
unless res.is_a?(Net::HTTPSuccess) && body_present?(res.body)
|
||||
FileUtils.remove_entry(dest)
|
||||
raise Error, "agent GET recordings HTTP #{res.code} #{res.body.to_s.truncate(200)}"
|
||||
raise Error, "agent GET recordings HTTP #{res.code} #{safe_body_snippet(res.body)}"
|
||||
end
|
||||
|
||||
tar_path = File.join(dest, "recordings.tar.gz")
|
||||
@@ -84,6 +84,14 @@ module Recordings
|
||||
ENV["STREAM_NODE_AGENT_SECRET"].presence || "mediamtx_webhook_dev_secret"
|
||||
end
|
||||
|
||||
def body_present?(body)
|
||||
body && !body.empty?
|
||||
end
|
||||
|
||||
def safe_body_snippet(body)
|
||||
body.to_s.dup.force_encoding("UTF-8").scrub[0, 200]
|
||||
end
|
||||
|
||||
def unpack!(tar_path, dest)
|
||||
ok = system("tar", "-xzf", tar_path, "-C", dest, out: File::NULL, err: File::NULL)
|
||||
raise Error, "tar extract failed" unless ok
|
||||
|
||||
Reference in New Issue
Block a user