Open itdependsnetworks opened 3 weeks ago
ServiceNowCRUDMixin._sys_id_cache
and ServiceNowDiffSync.objects_to_delete
should both become instance attributes and/or be explicitly emptied out at job start time.
@glennmatthews Would something like this work?
class ServiceNowCRUDMixin:
"""Mixin class for all ServiceNow models, to support CRUD operations based on mappings.yaml."""
_sys_id_cache = {}
"""Dict of table -> column_name -> value -> sys_id."""
def model_rebuild(cls):
super().model_rebuild()
cls._sys_id_cache = {}
we are calling model_rebuild at the end of the file anyway.
Environment
Expected Behavior
Observed Behavior
Steps to Reproduce
Ways to work around
Set
--max-tasks-per-child
on celery worker.