Skip to content
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

Improvements to Acquiring Lock File #356

Merged
merged 1 commit into from
Nov 16, 2024

Conversation

Martinski4GitHub
Copy link
Collaborator

Code improvements when the script is trying to obtain a lock file by allowing a 2nd instance to wait for the 1st instance to perform its job and exit. This means that 2 or more instances could execute in a staggered pattern and not terminate immediately when a lock file is found.

Code improvements when the script is trying to obtain a lock file by allowing a 2nd instance to wait for the 1st instance to perform its job and exit. This means that 2 or more instances could execute in a staggered pattern and not terminate immediately when a lock file is found.
@Martinski4GitHub
Copy link
Collaborator Author

@ExtremeFiretop,

Please review & test this PR when you get a chance.

Essentially, the way the "_AcquireLock_" function works now is that it allows any secondary instances while the current process is executing to wait for a 120-sec maximum timeout (unless no parameter is given in which case the timeout is only 10 seconds) for the Lock file to be available. Once the Lock file becomes available, the 2nd instance takes the Lock and can proceed normally. The assumption here is that a normal script execution launched from the "services-start" script file would take less than 120 seconds to exit (e.g. "addCronJob" or "postUpdateEmail"). The only outlier (so far) would be the call to do the "postRebootRun" which can take more than 120 seconds, but in such a case a F/W Update and a subsequent reboot are expected anyway.

@ExtremeFiretop
Copy link
Owner

@Martinski4GitHub

Sorry buddy was a busy day and I was tired so I didn't get to test this out.
However I noticed a new alpha for 3006 so I'm going to test this out now and advise! :)

@ExtremeFiretop ExtremeFiretop merged commit 539c91b into ExtremeFiretop:dev Nov 16, 2024
1 check passed
@ExtremeFiretop
Copy link
Owner

Tested! And worked perfectly!! :)

image

@Martinski4GitHub
Copy link
Collaborator Author

@Martinski4GitHub

Sorry buddy was a busy day and I was tired so I didn't get to test this out. However I noticed a new alpha for 3006 so I'm going to test this out now and advise! :)

No worries, bud. I completely get it. We both have "other things" going on and sometimes we're too tired to do other things.

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