def scheduleGroupRefreshJob(service, store): """ Schedule GroupCacherPollingWork """ txn = store.newTransaction() print("Scheduling a group refresh") yield GroupCacherPollingWork.reschedule(txn, 0, force=True) yield txn.commit()
def action_refreshgroups(self, j): txn = self._store.newTransaction() yield txn.directoryService().flush() work = yield GroupCacherPollingWork.reschedule(txn, 0, force=True) jobID = work.jobID yield txn.commit() if "wait" in j and j["wait"]: yield JobItem.waitJobDone(self._store.newTransaction, reactor, 60.0, jobID) yield JobItem.waitWorkDone(self._store.newTransaction, reactor, 60.0, ( GroupRefreshWork, GroupAttendeeReconciliationWork, GroupDelegateChangesWork, GroupShareeReconciliationWork, )) returnValue(self._ok("ok", "Group refresh scheduled"))
def action_refreshgroups(self, j): txn = self._store.newTransaction(label="ControlAPIResource.action_refreshgroups") yield txn.directoryService().flush() work = yield GroupCacherPollingWork.reschedule(txn, 0, force=True) jobID = work.jobID yield txn.commit() if "wait" in j and j["wait"]: yield JobItem.waitJobDone(self._store.newTransaction, reactor, 60.0, jobID) yield JobItem.waitWorkDone(self._store.newTransaction, reactor, 60.0, ( GroupRefreshWork, GroupAttendeeReconciliationWork, GroupDelegateChangesWork, GroupShareeReconciliationWork, )) returnValue(self._ok("ok", "Group refresh scheduled"))
def groupPollNow(txn): from txdav.who.groups import GroupCacherPollingWork return GroupCacherPollingWork.reschedule(txn, 0, force=True)
def groupPollNow(txn): return GroupCacherPollingWork.reschedule(txn, 0, force=True)