deletes unnecessary file
This commit is contained in:
parent
d6c72265f9
commit
4f8040e9db
@ -1,21 +0,0 @@
|
|||||||
import time
|
|
||||||
|
|
||||||
from .db import db
|
|
||||||
from .models import PaperMetadata
|
|
||||||
|
|
||||||
|
|
||||||
def run_scraper():
|
|
||||||
while True:
|
|
||||||
with db.app.app_context():
|
|
||||||
paper = Paper.query.filter_by(status="Pending").first()
|
|
||||||
if paper:
|
|
||||||
try:
|
|
||||||
# Scraping logic (e.g. download PDF)
|
|
||||||
paper.status = "Done"
|
|
||||||
paper.file_path = "papers/some_path.pdf"
|
|
||||||
except Exception as e:
|
|
||||||
paper.status = "Failed"
|
|
||||||
paper.error_message = str(e)
|
|
||||||
db.session.commit()
|
|
||||||
else:
|
|
||||||
time.sleep(60)
|
|
Loading…
x
Reference in New Issue
Block a user