habulaj commited on
Commit
3bf0942
·
verified ·
1 Parent(s): 1be0689

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +5 -0
main.py CHANGED
@@ -657,6 +657,11 @@ LEGENDA ORIGINAL:
657
 
658
  except Exception as e:
659
  print(f"⚠️ Erro em run_process_url background: {e}")
 
 
 
 
 
660
  finally:
661
  if temp_file and os.path.exists(temp_file.name): os.unlink(temp_file.name)
662
  if cropped_file_path and os.path.exists(cropped_file_path): os.unlink(cropped_file_path)
 
657
 
658
  except Exception as e:
659
  print(f"⚠️ Erro em run_process_url background: {e}")
660
+ try:
661
+ error_message = str(e)
662
+ requests.patch(f"{supabase_url}/rest/v1/posts?id=eq.{record_id}", headers=headers, json={"result": error_message})
663
+ except Exception as patch_e:
664
+ print(f"⚠️ Erro ao salvar erro no Supabase: {patch_e}")
665
  finally:
666
  if temp_file and os.path.exists(temp_file.name): os.unlink(temp_file.name)
667
  if cropped_file_path and os.path.exists(cropped_file_path): os.unlink(cropped_file_path)