Skip to content

Commit

Permalink
Correct event handling for managing multiple housekeepers in same scope.
Browse files Browse the repository at this point in the history
This makes the MythEvent process properly handle hostname and scope to
make sure runtimes are only updated when received from another
conflicting housekeeper and task.
  • Loading branch information
wagnerrp committed Jun 9, 2013
1 parent a2d9e89 commit e167dfb
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
10 changes: 9 additions & 1 deletion mythtv/libs/libmythbase/housekeeper.cpp
Expand Up @@ -663,7 +663,15 @@ void HouseKeeper::customEvent(QEvent *e)

QMutexLocker mapLock(&m_mapLock);
if (m_taskMap.contains(tag))
m_taskMap[tag]->SetLastRun(last);
{
if ((m_taskMap[tag]->GetScope() == kHKGlobal) ||
((m_taskMap[tag]->GetScope() == kHKLocal) &&
(gCoreContext->GetHostName() == hostname)))
// task being run in the same scope as us.
// update the run time so we don't attempt to run
// it ourselves
m_taskMap[tag]->SetLastRun(last);
}
}
}
}
Expand Down
1 change: 1 addition & 0 deletions mythtv/libs/libmythbase/housekeeper.h
Expand Up @@ -48,6 +48,7 @@ class MBASE_PUBLIC HouseKeeperTask : public ReferenceCounter

QString GetTag(void) { return m_dbTag; }
QDateTime GetLastRun(void) { return m_lastRun; }
HouseKeeperScope GetScope(void) { return m_scope; }
QDateTime QueryLastRun(void);
QDateTime UpdateLastRun(void)
{ return UpdateLastRun(MythDate::current()); }
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythbase/mythversion.h
Expand Up @@ -12,7 +12,7 @@
/// Update this whenever the plug-in ABI changes.
/// Including changes in the libmythbase, libmyth, libmythtv, libmythav* and
/// libmythui class methods in exported headers.
#define MYTH_BINARY_VERSION "0.27.20130608-1"
#define MYTH_BINARY_VERSION "0.27.20130608-2"

/** \brief Increment this whenever the MythTV network protocol changes.
*
Expand Down

0 comments on commit e167dfb

Please sign in to comment.