(func)
return wrapper
Decorator that flushes the bulk insert queue in the datastore.
Decorator that flushes the bulk insert queue in the datastore.
Decorator that flushes the bulk insert queue in the datastore .
def _flush_datastore_decorator(func):
    """Decorator that flushes the bulk insert queue in the datastore."""

    def wrapper(self, *args, **kwargs):
        func_return = func(self, *args, **kwargs)

        # Add in tagged events and emojis.
        for event_dict in self.tagged_events.values():
            event = event_dict.get('event')
            tags = event_dict.get('tags')

            event.commit({'tag': tags})

        for event_dict in self.emoji_events.values():
            event = event_dict.get('event')
            emojis = event_dict.get('emojis')

            event.commit({'__ts_emojis': emojis})

        self.datastore.flush_queued_events()
        return func_return
    return wrapper
def _flush_datastore_decorator ( func ) : def wrapper ( self , * args , * * kwargs ) : func_return = func ( self , * args , * * kwargs ) # Add in tagged events and emojis. for event_dict in self . tagged_events . values ( ) : event = event_dict . get ( 'event' ) tags = event_dict . get ( 'tags' ) event . commit ( { 'tag' : tags } ) for event_dict in self . emoji_events . values ( ) : event = event_dict . get ( 'event' ) emojis = event_dict . get ( 'emojis' ) event . commit ( { '__ts_emojis' : emojis } ) self . datastore . flush_queued_events ( ) return func_return return wrapper