Skip to content

Commit

Permalink
entity: use in memory for sync task
Browse files Browse the repository at this point in the history
* Uses in memory for the sync task.

Co-Authored-by: Peter Weber <[email protected]>
  • Loading branch information
rerowep authored and PascalRepond committed Oct 25, 2023
1 parent 057647d commit 3ba4242
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions rero_ils/modules/entities/remote_entities/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ def delete_records(records, verbose=False):


@shared_task(ignore_result=True)
def sync_entities(from_last_date=True, verbose=0, dry_run=False):
def sync_entities(
from_last_date=True, verbose=0, dry_run=False, in_memory=True):
"""Synchronize the entities within the MEF server.
:param from_last_date: (boolean) if True try to consider agent modified
Expand All @@ -62,7 +63,8 @@ def sync_entities(from_last_date=True, verbose=0, dry_run=False):
"""
sync_entity = SyncEntity(
from_last_date=from_last_date, verbose=verbose, dry_run=dry_run)
n_doc_updated, n_mef_updated, sync_mef_errors = sync_entity.sync()
n_doc_updated, n_mef_updated, sync_mef_errors = sync_entity.sync(
in_memory=in_memory)
n_mef_removed, clean_mef_errors = sync_entity.remove_unused()
return {
'n_doc_updated': n_doc_updated,
Expand Down

0 comments on commit 3ba4242

Please sign in to comment.