@@ -364,8 +364,9 @@ async function fetchAllPbsTasksForProcessing({ client, config }, nodeName) {
364
364
let allBackupTasks = [ ] ;
365
365
let deduplicationFactor = null ;
366
366
367
- // Calculate 30-day cutoff timestamp
368
- const thirtyDaysAgo = Math . floor ( ( Date . now ( ) - 30 * 24 * 60 * 60 * 1000 ) / 1000 ) ;
367
+ // Calculate cutoff timestamp - default to 365 days for calendar view
368
+ const backupHistoryDays = parseInt ( process . env . BACKUP_HISTORY_DAYS || '365' ) ;
369
+ const thirtyDaysAgo = Math . floor ( ( Date . now ( ) - backupHistoryDays * 24 * 60 * 60 * 1000 ) / 1000 ) ;
369
370
370
371
// Track backup runs by date and guest to avoid counting multiple snapshots per day
371
372
// Use a more comprehensive key to prevent any duplicates
@@ -390,7 +391,7 @@ async function fetchAllPbsTasksForProcessing({ client, config }, nodeName) {
390
391
const groupsResponse = await client . get ( `/admin/datastore/${ datastore . name } /groups` ) ;
391
392
const groups = groupsResponse . data ?. data || [ ] ;
392
393
393
- // For each backup group, get recent snapshots (30 days only)
394
+ // For each backup group, get snapshots within history period
394
395
for ( const group of groups ) {
395
396
try {
396
397
const snapshotsResponse = await client . get ( `/admin/datastore/${ datastore . name } /snapshots` , {
@@ -401,7 +402,7 @@ async function fetchAllPbsTasksForProcessing({ client, config }, nodeName) {
401
402
} ) ;
402
403
const allSnapshots = snapshotsResponse . data ?. data || [ ] ;
403
404
404
- // Filter snapshots to last 30 days only
405
+ // Filter snapshots to configured history period
405
406
const recentSnapshots = allSnapshots . filter ( snapshot => {
406
407
return snapshot [ 'backup-time' ] >= thirtyDaysAgo ;
407
408
} ) ;
@@ -477,7 +478,7 @@ async function fetchAllPbsTasksForProcessing({ client, config }, nodeName) {
477
478
} ) ;
478
479
const allAdminTasks = response . data ?. data || [ ] ;
479
480
480
- // Filter admin tasks to last 30 days
481
+ // Filter admin tasks to configured history period
481
482
const recentAdminTasks = allAdminTasks . filter ( task => task . starttime >= thirtyDaysAgo ) ;
482
483
483
484
// Separate real backup tasks (for enhancement only) from other admin tasks
@@ -600,10 +601,11 @@ async function fetchPveBackupTasks(apiClient, endpointId, nodeName) {
600
601
} ) ;
601
602
const tasks = response . data ?. data || [ ] ;
602
603
603
- // Calculate 30-day cutoff timestamp
604
- const thirtyDaysAgo = Math . floor ( ( Date . now ( ) - 30 * 24 * 60 * 60 * 1000 ) / 1000 ) ;
604
+ // Calculate cutoff timestamp - default to 365 days for calendar view
605
+ const backupHistoryDays = parseInt ( process . env . BACKUP_HISTORY_DAYS || '365' ) ;
606
+ const thirtyDaysAgo = Math . floor ( ( Date . now ( ) - backupHistoryDays * 24 * 60 * 60 * 1000 ) / 1000 ) ;
605
607
606
- // Filter to last 30 days and transform to match PBS backup task format
608
+ // Filter to configured history period and transform to match PBS backup task format
607
609
return tasks
608
610
. filter ( task => task . starttime >= thirtyDaysAgo )
609
611
. map ( task => {
0 commit comments