Move queue handling to a separate private method

This commit is contained in:
Richard Frith-Macdonald 2020-07-17 15:35:10 +01:00
parent d8b9b68ee5
commit 272f9dc9c9

View file

@ -1528,18 +1528,10 @@ objectsTable_handler(netsnmp_mib_handler *handler,
return changed;
}
- (void) snmpHousekeeping
- (BOOL) _processQueue
{
ENTER_POOL
time_t now;
BOOL changed = NO;
DEBUGMSGTL(("EcAlarmSinkHousekeeping", "Timer called.\n"));
[_alarmLock lock];
if (NO == _inTimeout && YES == _isRunning)
{
_inTimeout = YES;
NS_DURING
{
/* If we have too many clears, remove the oldest one.
@ -1789,9 +1781,25 @@ objectsTable_handler(netsnmp_mib_handler *handler,
}
NS_HANDLER
{
NSLog(@"Problem in housekeeping timeout: %@", localException);
NSLog(@"Problem processing queue: %@", localException);
}
NS_ENDHANDLER
return changed;
}
- (void) snmpHousekeeping
{
ENTER_POOL
time_t now;
BOOL changed;
DEBUGMSGTL(("EcAlarmSinkHousekeeping", "Timer called.\n"));
[_alarmLock lock];
if (NO == _inTimeout && YES == _isRunning)
{
_inTimeout = YES;
changed = [self _processQueue];
_inTimeout = NO;
}
if (YES == _shouldStop)