mirror of
https://github.com/odoo/runbot.git
synced 2025-03-15 23:45:44 +07:00
[FIX] runbot: limit max log size
In some case, a build can add a lot of info in a log, there is already a limit to the number of entry but not to the size of an entry. This will limit the database usage in case of mistake/abuse.
This commit is contained in:
parent
5a5e7693d4
commit
64d3c59ed9
@ -251,6 +251,10 @@ class Host(models.Model):
|
||||
ir_log['message'] = 'Log limit reached (full logs are still available in the log file)'
|
||||
elif log_counter < 0:
|
||||
continue
|
||||
else:
|
||||
if len(ir_log['message']) > 10000:
|
||||
ir_log['message'] = ir_log['message'][:10000] + "\n ...<message too long, truncated>"
|
||||
|
||||
ir_log['build_id'] = build.id
|
||||
logs_to_send.append({k:ir_log[k] for k in ir_log if k != 'id'})
|
||||
build.log_counter = log_counter
|
||||
|
Loading…
Reference in New Issue
Block a user