Method: OpenC3::PacketLogWriter#close_file
- Defined in:
- lib/openc3/logs/packet_log_writer.rb
#close_file(take_mutex = true) ⇒ Object
Closing a log file isn’t critical so we just log an error Returns threads that moves log to bucket
144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 |
# File 'lib/openc3/logs/packet_log_writer.rb', line 144 def close_file(take_mutex = true) threads = [] @mutex.lock if take_mutex begin # Need to write the OFFSET_MARKER for each packet @last_offsets.each do |redis_topic, last_offset| write_entry(:OFFSET_MARKER, nil, nil, nil, nil, nil, last_offset + ',' + redis_topic, nil) if @file end threads.concat(super(false)) ensure @mutex.unlock if take_mutex end return threads end |