improve geocoding

This commit is contained in:
orangecoding
2026-01-28 15:55:23 +01:00
parent 472169693f
commit 0b2b42fc75
10 changed files with 55 additions and 50 deletions

View File

@@ -9,7 +9,7 @@ import { geocodeAddress, isGeocodingPaused } from '../geocoding/geoCodingService
import { getJobs } from '../storage/jobStorage.js';
import { calculateDistanceForJob } from '../geocoding/distanceService.js';
async function runTask() {
export async function runGeoCordTask() {
const listings = getListingsToGeocode();
if (listings.length > 0) {
for (const listing of listings) {
@@ -33,7 +33,7 @@ async function runTask() {
export async function initGeocodingCron() {
// run directly on start
await runTask();
await runGeoCordTask();
// then every 6 hours
cron.schedule('0 */6 * * *', runTask);
cron.schedule('0 */6 * * *', runGeoCordTask);
}