feat: refresh stale last pickup information
Track the successful member-list check time and refresh stale pickup information asynchronously after the GUI loads without triggering dormant warnings.
This commit is contained in:
11
server.js
11
server.js
@@ -12,6 +12,7 @@ const {
|
||||
runStoreWatchCheck,
|
||||
runImmediatePickupCheck,
|
||||
runDormantMembershipCheck,
|
||||
refreshStaleLastPickupInfo,
|
||||
getRegularPickupSchedule,
|
||||
scheduleRegularPickupRefresh
|
||||
} = require('./services/pickupScheduler');
|
||||
@@ -1424,6 +1425,16 @@ app.post('/api/config/check', requireAuth, (req, res) => {
|
||||
res.json({ success: true });
|
||||
});
|
||||
|
||||
app.post('/api/config/last-pickup/refresh', requireAuth, async (req, res) => {
|
||||
try {
|
||||
const result = await refreshStaleLastPickupInfo(req.session.id);
|
||||
res.json({ success: true, ...result });
|
||||
} catch (error) {
|
||||
console.error('[PICKUP] Letzte Abholung konnte nicht aktualisiert werden:', error.message);
|
||||
res.status(502).json({ error: 'Letzte Abholung konnte nicht aktualisiert werden.' });
|
||||
}
|
||||
});
|
||||
|
||||
app.get('/api/pickups/registered', requireAuth, async (req, res) => {
|
||||
try {
|
||||
const pickups = await withSessionRetry(
|
||||
|
||||
Reference in New Issue
Block a user