Did I find the right examples for you? yes no

All Samples(2)  |  Call(1)  |  Derive(0)  |  Import(1)

src/s/t/statusboard-HEAD/statusboard/plugins/__init__.py   statusboard(Download)
 
from statusboard.core.models import GatherRequest
from statusboard.core.utils import guess_app, json_hash
 
plugin_registry = {}
    def gather_request(self, args=None, user=None, run_for=300):
        args_hash = json_hash(args)
        request, created = GatherRequest.objects.get_or_create(plugin=self._plugin_name, user=user, args_hash=args_hash, defaults={'ts': datetime.datetime.now(), 'until': datetime.datetime.now()+datetime.timedelta(seconds=run_for), 'args': args})
        if not created:
            request.until = datetime.datetime.now()+datetime.timedelta(seconds=run_for)