Improve autolaunch if a process is misconfigured

This commit is contained in:
Richard Frith-Macdonald 2022-11-04 10:29:04 +00:00
parent f302d89e0b
commit 298c8bda79
2 changed files with 26 additions and 0 deletions

View file

@ -1,3 +1,10 @@
2022-11-04 Richard Frith-Macdonald <rfm@gnu.org>
* EcCommand.m: When a process shuts down due to a configuration error
autolaunch is deferred for 5 minutes because human intervention is
unlikely to be rapid (thereiis no point repeatedly trying to autolaunch
a misconfigured process).
2022-11-01 Richard Frith-Macdonald <rfm@gnu.org>
* EcAlarmDestination.h:

View file

@ -2287,6 +2287,17 @@ valgrindLog(NSString *name)
self, [NSThread callStackSymbols]);
}
[self resetDelay];
if (terminationStatusKnown)
{
if (-3 == terminationStatus) // configuration error
{
/* Defer the actual launch for 5 minutes since a config error
* requires human intervention and is unlikely to be fixed
* very quickly.
*/
deferredDate = [NSDate timeIntervalSinceReferenceDate] + 300.0;
}
}
startingAlarm = NO;
startingDate = [NSDate timeIntervalSinceReferenceDate];
startingTimer = [NSTimer
@ -4362,12 +4373,20 @@ NSLog(@"Problem %@", localException);
if (NO == all || [u count] > 0)
{
NSString *r;
if ([u count] > 0)
{
[s appendFormat:
@" %-32.32s is queued waiting for %@\n",
[key UTF8String], u];
}
else if (nil != (r = [l reasonToPreventLaunch]))
{
[s appendFormat:
@" %-32.32s queued: %@\n",
[key UTF8String], r];
}
else
{
[s appendFormat: