Only save dirty fields on Queue queries.
This commit is contained in:
parent
99f69c9631
commit
7c490b46c8
2 changed files with 6 additions and 1 deletions
|
@ -758,6 +758,11 @@ class QueueItem(BaseModel):
|
||||||
processing_expires = DateTimeField(null=True, index=True)
|
processing_expires = DateTimeField(null=True, index=True)
|
||||||
retries_remaining = IntegerField(default=5, index=True)
|
retries_remaining = IntegerField(default=5, index=True)
|
||||||
|
|
||||||
|
class Meta:
|
||||||
|
database = db
|
||||||
|
read_slaves = (read_slave,)
|
||||||
|
only_save_dirty = True
|
||||||
|
|
||||||
|
|
||||||
class RepositoryBuild(BaseModel):
|
class RepositoryBuild(BaseModel):
|
||||||
uuid = CharField(default=uuid_generator, index=True)
|
uuid = CharField(default=uuid_generator, index=True)
|
||||||
|
|
|
@ -270,7 +270,7 @@ class WorkQueue(object):
|
||||||
queue_item.processing_expires = new_expiration
|
queue_item.processing_expires = new_expiration
|
||||||
has_change = True
|
has_change = True
|
||||||
|
|
||||||
if updated_data is not None:
|
if updated_data is not None and queue_item.body != updated_data:
|
||||||
queue_item.body = updated_data
|
queue_item.body = updated_data
|
||||||
has_change = True
|
has_change = True
|
||||||
|
|
||||||
|
|
Reference in a new issue