diff --git a/app.py b/app.py index ad17e05..034dbe7 100644 --- a/app.py +++ b/app.py @@ -115,6 +115,7 @@ def add_product(dict_good, location): data_barcode = { "product_id": int(response_grocy["created_object_id"]), "barcode": dict_good["gtin"], + "amount": 1.0, } grocy.add_generic(EntityType.PRODUCT_BARCODES, data_barcode) # add barcode, EAN-13, ex. 6921168593910 @@ -122,6 +123,7 @@ def add_product(dict_good, location): data_barcode = { "product_id": int(response_grocy["created_object_id"]), "barcode": dict_good["gtin"].lstrip("0"), + "amount": 1.0, } grocy.add_generic(EntityType.PRODUCT_BARCODES, data_barcode) @@ -425,7 +427,7 @@ def add_to_stream(): # 初始化 APScheduler 并添加定时任务 scheduler = BackgroundScheduler() -scheduler.add_job(func=consume_stream, trigger="interval", seconds=300) +scheduler.add_job(func=consume_stream, trigger="interval", seconds=10) scheduler.start() # 确保程序退出时停止定时任务