-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[NC | NSFS] use fixed hh:mm
for running expiry script
#7952
[NC | NSFS] use fixed hh:mm
for running expiry script
#7952
Conversation
hh:mm
hh:mm
for running expiry script
7aa83d7
to
10c9698
Compare
10c9698
to
c07d67d
Compare
863f8a3
to
c534023
Compare
if (config.NSFS_GLACIER_EXPIRY_TZ === 'UTC') { | ||
min_time.setUTCHours(desired_hour); | ||
min_time.setUTCMinutes(desired_min); | ||
} else { | ||
min_time.setHours(desired_hour); | ||
min_time.setMinutes(desired_min); | ||
} | ||
|
||
const max_time = new Date(); | ||
if (config.NSFS_GLACIER_EXPIRY_TZ === 'UTC') { | ||
max_time.setUTCHours(desired_hour); | ||
max_time.setUTCMinutes(desired_min + tolerate_mins); | ||
} else { | ||
max_time.setHours(desired_hour); | ||
max_time.setMinutes(desired_min + tolerate_mins); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you refactor this to a utility function to avoid copy-pasta issues?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also don't we need to set the seconds and millis to 0?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have set the secs to 0 now but not millis. Considering the granularity is minutes, does it matter?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer it to be clear and not have random millis.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
c534023
to
84d6ca5
Compare
b22e7b4
to
0e5d583
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good, but i would still zero the millis.
Signed-off-by: Utkarsh Srivastava <srivastavautkarsh8097@gmail.com> address PR comments Signed-off-by: Utkarsh Srivastava <srivastavautkarsh8097@gmail.com> set millis to 0 Signed-off-by: Utkarsh Srivastava <srivastavautkarsh8097@gmail.com>
0e5d583
to
90a2fa6
Compare
Explain the changes
This PR moves away from running expiry script on certain interval and instead use a configurable
hh:mm
or when the disk is running low on space.The granularity is minutes instead of seconds to account for scheduler mess ups.