Skip to content

Feature/self heal cron#260

Open
aj970-crypto wants to merge 1 commit intodevelopfrom
feature/SelfHealCron
Open

Feature/self heal cron#260
aj970-crypto wants to merge 1 commit intodevelopfrom
feature/SelfHealCron

Conversation

@aj970-crypto
Copy link
Copy Markdown
Contributor

Checking

Signed-off-by: aj970 <akshaya_j@comcast.com>
@aj970-crypto aj970-crypto requested review from a team as code owners March 12, 2026 12:38
Copilot AI review requested due to automatic review settings March 12, 2026 12:38
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the cron initialization logic to conditionally skip scheduling selfheal_aggressive.sh for a specific platform (WNXL11BWL) while keeping other SelfHeal cron jobs intact.

Changes:

  • Gate creation of the selfheal_aggressive.sh cron entry behind a BOX_TYPE != WNXL11BWL check.
  • Move AggressiveInterval retrieval/defaulting inside the new platform guard.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment on lines +178 to +180
if [ -z "$AGGRESSIVE_INTERVAL" ]; then
AGGRESSIVE_INTERVAL=5
fi
Copy link

Copilot AI Mar 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AGGRESSIVE_INTERVAL comes from syscfg and is interpolated directly into a cron schedule. If it contains non-numeric characters/whitespace (e.g., empty, 0, or a value with spaces), this can generate an invalid crontab line or allow cron field injection. Consider validating it as a positive integer (and enforcing a sane min/max) before appending to $CRONTAB_FILE, falling back to the default when invalid.

Suggested change
if [ -z "$AGGRESSIVE_INTERVAL" ]; then
AGGRESSIVE_INTERVAL=5
fi
# Validate AGGRESSIVE_INTERVAL as a positive integer within sane bounds; fallback to default (5) if invalid
case "$AGGRESSIVE_INTERVAL" in
''|*[!0-9]*)
AGGRESSIVE_INTERVAL=5
;;
*)
if [ "$AGGRESSIVE_INTERVAL" -eq 0 ] || [ "$AGGRESSIVE_INTERVAL" -gt 1440 ]; then
AGGRESSIVE_INTERVAL=5
fi
;;
esac

Copilot uses AI. Check for mistakes.
@aj970-crypto aj970-crypto force-pushed the feature/SelfHealCron branch from 358d703 to 1f8ff46 Compare March 13, 2026 11:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants