in tooling/enrichment/firestore_client.py [0:0]
def start_product_processing(self, product_id, product_data):
"""Mark a product as being processed."""
doc_ref = self.collection.document(str(product_id))
doc = doc_ref.get()
data = {
'status': 'processing',
'product_data': product_data,
'started_at': firestore.SERVER_TIMESTAMP,
'updated_at': firestore.SERVER_TIMESTAMP,
'retry_count': 0
}
# If document exists, increment retry count
if doc.exists:
current_retry = doc.to_dict().get('retry_count', 0)
data['retry_count'] = current_retry + 1
doc_ref.set(data)