def checkForLivenessAndResume(args, batch): '''Check for liveness of PV's and then bulk resume those that are alive''' if not batch: return logger.debug("Checking for liveness of %s PVs", len(batch)) livePVs = multiplePVCheck.checkMultiplePVs(batch, float(args.timeout)) if livePVs: logger.info("Resuming %s live PVs", len(livePVs)) resumePVs(args.url, list(livePVs))
def checkForLivenessAndPause(args, batch): '''Check for liveness of PV's and then bulk pause those that have not yet connected''' if not batch: return logger.debug("Checking for liveness of %s PVs", len(batch)) livePVs = multiplePVCheck.checkMultiplePVs(batch, float(args.timeout)) disConnPVs = list(set(batch) - set(livePVs)) if disConnPVs: logger.info("Detected %s disconnected PVs", len(disConnPVs)) pausePVs(args.url, disConnPVs)
def checkForLivenessAndSubmitToArchiver(args, expandedNames, batchedPVConfig): '''Check for liveness of PV and submit those PV's that are live to the archiver''' if not batchedPVConfig: return url = args.url logger.debug("Checking for liveness of %s PVs", len(batchedPVConfig.keys())) unarchivedLivePvs = multiplePVCheck.checkMultiplePVs( batchedPVConfig.keys(), float(args.timeout)) if unarchivedLivePvs: logger.info("Submitting %s new PVs to the archiver", len(unarchivedLivePvs)) logger.info("Submitting these PVs to the archiver %s", ",".join(unarchivedLivePvs)) unarchivedPVsConfig = [batchedPVConfig[x] for x in unarchivedLivePvs] archivePVs(url, unarchivedPVsConfig) expandedNames.update(unarchivedLivePvs) else: logger.debug("Skipped potentially %s stale PVs", len(batchedPVConfig.keys())) batchedPVConfig.clear()