make sure that init downloads exactly the last count available images

This commit is contained in:
Quentin Roussel
2024-08-18 13:48:56 +08:00
parent 3119f41941
commit 074bcf20d7
2 changed files with 13 additions and 6 deletions

View File

@@ -1,11 +1,13 @@
import { initImages, updateImages } from './downloader.mjs';
initImages(10).then(() => {
const IMAGE_COUNT = 5;
initImages(IMAGE_COUNT).then(() => {
console.log('Downloaded initial images successfully');
});
setInterval(() => {
updateImages(10).then(() => {
updateImages(IMAGE_COUNT).then(() => {
console.log('Updated images successfully');
});
}, 5 * 60 * 1000);