def schedule_housekeeping(cmd, is_leader): JBoxd.publish_perf_counters() features = [JBPluginTask.JBP_NODE] if is_leader is True: features.append(JBPluginTask.JBP_CLUSTER) for feature in features: for plugin in JBPluginTask.jbox_get_plugins(feature): JBoxd.schedule_thread(cmd, plugin.do_periodic_task, (feature,))
def plugin_action(plugin_type, plugin_class, data): matching_plugin = None for plugin in JBPluginTask.jbox_get_plugins(plugin_type): if plugin_class is None: matching_plugin = plugin break elif plugin_class == plugin.__name__: matching_plugin = plugin break if matching_plugin is not None: matching_plugin.do_task(plugin_type, data)
def schedule_housekeeping(cmd, is_leader): JBoxd.publish_perf_counters() JBoxd.publish_sessions() JBoxd.publish_instance_state() features = [JBPluginTask.JBP_NODE] if is_leader is True: JBoxInstanceProps.purge_stale_instances(Compute.get_install_id()) features.append(JBPluginTask.JBP_CLUSTER) for feature in features: for plugin in JBPluginTask.jbox_get_plugins(feature): JBoxd.schedule_thread(cmd, plugin.do_periodic_task, (feature,))