Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: import product DB every day #119

Merged
merged 1 commit into from
Jan 5, 2024
Merged

feat: import product DB every day #119

merged 1 commit into from
Jan 5, 2024

Conversation

raphael0202
Copy link
Contributor

@raphael0202 raphael0202 commented Jan 5, 2024

Add:

  • CLI with Typer
  • CLI command to import/update products in DB
  • scheduler (APScheduler)
  • scheduled job everyday to import/update new products in DB
  • new field Product.unique_scans_n

@raphael0202 raphael0202 merged commit b60c3ac into main Jan 5, 2024
4 checks passed
@raphael0202 raphael0202 deleted the add-db-import branch January 5, 2024 13:24
@raphodn raphodn linked an issue Jan 7, 2024 that may be closed by this pull request
@@ -44,6 +44,7 @@ class Product(Base):
product_quantity = Column(Integer)
brands = Column(String)
image_url = Column(String)
unique_scans_n = Column(Integer, nullable=True)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we could default this to 0 ?

scheduler = BlockingScheduler()
scheduler.add_executor(ThreadPoolExecutor(20))
scheduler.add_jobstore(MemoryJobStore())
scheduler.add_job(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so if we deploy this it will run every morning at 6AM is that right ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prod only, or also preprod ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Import & sync the whole database with OFF
2 participants