snapshots: save disk space by not automatically saving big objects (#47297)
This commit is contained in:
parent
4e3e20079a
commit
1159961be8
|
@ -54,6 +54,10 @@ class Snapshot:
|
|||
obj.comment = comment
|
||||
obj.label = label
|
||||
latest = cls.get_latest(obj.object_type, obj.object_id)
|
||||
if label is None and len(obj.serialization) > 1000000:
|
||||
# save disk space by not automatically saving big objects
|
||||
# (typically workflows with embedded documents)
|
||||
return
|
||||
if label is not None or latest is None or obj.serialization != latest.serialization:
|
||||
# save snapshot if there are changes or an explicit label was
|
||||
# given.
|
||||
|
|
Loading…
Reference in New Issue