このコミットが含まれているのは:
2026-10-29 23:31:04 +09:00
コミット efbd640963
8個のファイルの変更、201行の追加、19行の削除
+23 -1
ファイルの表示
@@ -184,7 +184,29 @@ class CountsExportJobs
write(state)
end
state.slice('status', 'phase', 'processed', 'total', 'format', 'token', 'error',
'updated_at', 'heartbeat_at')
'updated_at', 'heartbeat_at', 'download_attempt', 'download_status')
end
end
def self.download_attempt(token, owner, file_token: nil, attempt: nil, status: nil)
id = authorised_id(token, owner)
return unless id
synchronise do
state = read(id)
return unless (state && state['owner'] == owner && state['status'] == 'ready' &&
state['expires_at'] > Time.current.to_f && HistoryAccess.authorised_artifact?(state))
if attempt
return unless state['download_attempt'] == attempt && state['token'] == file_token
return unless state['download_status'] == 'pending'
state['download_status'] = status if status
else
state['download_attempt'] = SecureRandom.hex(24)
state['download_status'] = 'pending'
end
write(state)
state.slice('download_attempt', 'download_status', 'token')
end
end