mirror of
https://github.com/clucraft/PriceGhost.git
synced 2026-05-03 12:52:53 +02:00
Fix updateLastChecked calls to include refresh_interval
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
4acd5c1432
commit
fde620357a
3 changed files with 2923 additions and 4 deletions
|
|
@ -78,8 +78,8 @@ router.post('/:productId/refresh', async (req: AuthRequest, res: Response) => {
|
|||
);
|
||||
}
|
||||
|
||||
// Update last_checked timestamp
|
||||
await productQueries.updateLastChecked(productId);
|
||||
// Update last_checked timestamp and schedule next check
|
||||
await productQueries.updateLastChecked(productId, product.refresh_interval);
|
||||
|
||||
res.json({
|
||||
message: scrapedData.stockStatus === 'out_of_stock'
|
||||
|
|
|
|||
|
|
@ -69,8 +69,8 @@ router.post('/', async (req: AuthRequest, res: Response) => {
|
|||
);
|
||||
}
|
||||
|
||||
// Update last_checked timestamp
|
||||
await productQueries.updateLastChecked(product.id);
|
||||
// Update last_checked timestamp and schedule next check
|
||||
await productQueries.updateLastChecked(product.id, product.refresh_interval);
|
||||
|
||||
// Fetch the product with the price
|
||||
const productWithPrice = await productQueries.findById(product.id, userId);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue