Add retry-safe scan completion notifications
This commit is contained in:
@@ -2,7 +2,8 @@ import time
|
||||
|
||||
from django.core.management.base import BaseCommand
|
||||
|
||||
from food.services.inventory_scanner import process_next_scan_item
|
||||
from food.services.inventory_scanner import (dispatch_pending_scan_notifications,
|
||||
process_next_scan_item)
|
||||
|
||||
|
||||
class Command(BaseCommand):
|
||||
@@ -16,6 +17,7 @@ class Command(BaseCommand):
|
||||
def handle(self, *args, **options):
|
||||
processed = 0
|
||||
while True:
|
||||
dispatch_pending_scan_notifications()
|
||||
did_work = process_next_scan_item()
|
||||
if did_work:
|
||||
processed += 1
|
||||
|
||||
Reference in New Issue
Block a user