Skip to content

Commit

Permalink
fix: ent cat resource tweaks (#744)
Browse files Browse the repository at this point in the history
  • Loading branch information
johnnagro authored Jan 12, 2024
1 parent 6ba56d2 commit 246dccf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,9 @@ def handle(self, *args, **options):
logger.info(
'index_enterprise_catalog_in_algolia_task launching synchronously.'
)
# For some reason in order to call a celery task in-memory you must pass kwargs as args.
index_enterprise_catalog_in_algolia_task(force_task_execution, dry_run)
index_enterprise_catalog_in_algolia_task.apply(
kwargs={'force': force_task_execution, 'dry_run': dry_run}
)
else:
index_enterprise_catalog_in_algolia_task.apply_async(
kwargs={'force': force_task_execution, 'dry_run': dry_run}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def test_reindex_algolia_no_async(self, mock_command_config, mock_task):
'no_async': True,
}
call_command(self.command_name)
mock_task.assert_called_once_with(False, False) # force=False, dry_run=False
mock_task.apply.assert_called_once_with(kwargs={'force': False, 'dry_run': False}) # force=False, dry_run=False
mock_task.apply_async.assert_not_called()

@mock.patch(PATH_PREFIX + 'index_enterprise_catalog_in_algolia_task')
Expand Down

0 comments on commit 246dccf

Please sign in to comment.