Self hosted FLOSS fitness/workout, nutrition and weight tracker
Added task triggering logic to the sync-ingredients-async.py
Ali Rahbarc78da65bb8eb
diff --git a/wger/nutrition/management/commands/sync-ingredients-async.py b/wger/nutrition/management/commands/sync-ingredients-async.pyindex 75057e80c..3857391fc 100644--- a/wger/nutrition/management/commands/sync-ingredients-async.py+++ b/wger/nutrition/management/commands/sync-ingredients-async.py@@ -13,12 +13,18 @@# You should have received a copy of the GNU Affero General Public Licensefrom django.core.management.base import BaseCommand+from wger.nutrition.tasks import sync_all_ingredients_taskclass Command(BaseCommand):- help = "Synchronize all ingredients from a remote wger instance to the local database"+ help = "Asynchronously synchronize all ingredients from another wger instance."def handle(self, *args, **options):- self.stdout.write("Synchronizing all ingredients...")+ self.stdout.write("Triggering the Celery task to synchronize all ingredients...")++ # Trigger the task asynchronously+ sync_all_ingredients_task.delay()++ self.stdout.write("Synchronization task has been triggered. Check the Celery worker logs for progress.")