Change cron schedule & ignore converted/thumbs.
This commit is contained in:
@@ -29,7 +29,7 @@ export class DailyS3Scheduler {
|
|||||||
|
|
||||||
// Cron expression for midnight PST
|
// Cron expression for midnight PST
|
||||||
// Note: This uses PST timezone. During PDT (daylight time), it will still run at midnight local time
|
// Note: This uses PST timezone. During PDT (daylight time), it will still run at midnight local time
|
||||||
const cronExpression = "0 0 * * *"; // Every day at midnight
|
const cronExpression = "0 6 * * *"; // Every day at midnight
|
||||||
const timezone = "America/Los_Angeles"; // PST/PDT timezone
|
const timezone = "America/Los_Angeles"; // PST/PDT timezone
|
||||||
|
|
||||||
this.cronJob = cron.schedule(
|
this.cronJob = cron.schedule(
|
||||||
|
|||||||
@@ -273,6 +273,12 @@ export class S3Sync {
|
|||||||
const stat = await fsStat(itemPath);
|
const stat = await fsStat(itemPath);
|
||||||
|
|
||||||
if (stat.isDirectory()) {
|
if (stat.isDirectory()) {
|
||||||
|
// Skip thumbs and ConvertedOriginals folders (case-insensitive)
|
||||||
|
const itemLower = item.toLowerCase();
|
||||||
|
if (itemLower === "thumbs" || itemLower === "convertedoriginals") {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
// Recursively analyze subdirectories
|
// Recursively analyze subdirectories
|
||||||
const subStats = await this.getDirectoryStats(itemPath);
|
const subStats = await this.getDirectoryStats(itemPath);
|
||||||
document_count += subStats.document_count;
|
document_count += subStats.document_count;
|
||||||
@@ -452,6 +458,12 @@ async function getDirectoryStats(
|
|||||||
const stat = await fsStat(itemPath);
|
const stat = await fsStat(itemPath);
|
||||||
|
|
||||||
if (stat.isDirectory()) {
|
if (stat.isDirectory()) {
|
||||||
|
// Skip thumbs and ConvertedOriginals folders (case-insensitive)
|
||||||
|
const itemLower = item.toLowerCase();
|
||||||
|
if (itemLower === "thumbs" || itemLower === "convertedoriginals") {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
// Recursively analyze subdirectories
|
// Recursively analyze subdirectories
|
||||||
const subStats = await getDirectoryStats(itemPath);
|
const subStats = await getDirectoryStats(itemPath);
|
||||||
document_count += subStats.document_count;
|
document_count += subStats.document_count;
|
||||||
|
|||||||
Reference in New Issue
Block a user