Skip to content

Commit

Permalink
testing
Browse files Browse the repository at this point in the history
  • Loading branch information
tolzhabayev committed Dec 29, 2023
1 parent 22e7f94 commit f917626
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import fs from 'fs';

export default function cleanupFeatureFlags() {
const today = new Date();
const sixMonthAgo = today.setMonth(today.getMonth() - 6);
const inputFileContents = fs.readFileSync(process.env.FEATURE_TOGGLES_CSV_FILE_PATH);
const parsedFeatureFlags = parse(inputFileContents, {
columns: true,
Expand All @@ -25,9 +26,10 @@ export default function cleanupFeatureFlags() {
cast_date: true,
});

console.log('sixMonthAgo', sixMonthAgo);
for (const flag of parsedFeatureFlags) {
console.log(flag);
if (flag.Created > today.setMonth(today.getMonth() - 6)) {
console.log(flag);
if (flag.Created < sixMonthAgo) {
console.log(`The flag ${flag.Name} was created more than 6 months ago. It should be checked.`);
}
}
Expand Down

0 comments on commit f917626

Please sign in to comment.