예제 #1
0
    def _snap_gevent_block(self, **kwargs):
        from pyon.util.gevent_block_plugin import get_gevent_block
        snap_result = {}

        gevent_block_dict = {}
        snap_result["gevent_block"] = gevent_block_dict

        gevent_block = get_gevent_block()
        if gevent_block:
            #json encoding cannot take a non-string key. Let's clean it so it doesn't break persistence to db
            snap_shots = gevent_block.get_snapshots()
            for (_, gl_name), value in snap_shots.items():
                gevent_block_dict.update({gl_name: value})
        return snap_result
예제 #2
0
    def _snap_gevent_block(self, **kwargs):
        from pyon.util.gevent_block_plugin import get_gevent_block

        snap_result = {}

        gevent_block_dict = {}
        snap_result["gevent_block"] = gevent_block_dict

        gevent_block = get_gevent_block()
        if gevent_block:
            # json encoding cannot take a non-string key. Let's clean it so it doesn't break persistence to db
            snap_shots = gevent_block.get_snapshots()
            for (_, gl_name), value in snap_shots.items():
                gevent_block_dict.update({gl_name: value})
        return snap_result
예제 #3
0
 def handle_request(self, action):
     gevent_block = get_gevent_block()
     if gevent_block:
         gevent_block.stop()