コード例 #1
0
ファイル: __init__.py プロジェクト: sofian86/indico-gh-test
 def start(self, delay):
     self._executionDelay = delay
     try:
         self.run()
         self.endedOn = self._getCurrentDateTime()
     finally:
         LDAPConnector.destroy()
         self.running = False
コード例 #2
0
ファイル: __init__.py プロジェクト: pferreir/indico-backup
 def start(self, delay):
     if self.DISABLE_ZODB_HOOK:
         update_session_options(db)
     self._executionDelay = delay
     try:
         self.run()
         self.endedOn = self._getCurrentDateTime()
     finally:
         LDAPConnector.destroy()
         self.running = False
コード例 #3
0
ファイル: handlers.py プロジェクト: pferreir/indico-backup
                                                             'timestamp'),
                                                     separate=True)
                ak.used(request.remote_addr, normPath, normQuery,
                        not onlyPublic)
                try:
                    dbi.endRequest(True)
                except ConflictError:
                    pass  # retry
                else:
                    break
        else:
            # No need to commit stuff if we didn't use an API key
            # (nothing was written)
            dbi.endRequest(False)

        LDAPConnector.destroy()

        # Log successful POST api requests
        if error is None and request.method == 'POST':
            logger.info('API request: %s?%s' % (path, query))

        serializer = Serializer.create(dformat,
                                       query_params=queryParams,
                                       pretty=pretty,
                                       typeMap=typeMap,
                                       **hook.serializer_args)
        if error:
            if not serializer.schemaless:
                # if our serializer has a specific schema (HTML, ICAL, etc...)
                # use JSON, since it is universal
                serializer = Serializer.create('json')
コード例 #4
0
ファイル: handlers.py プロジェクト: NIIF/indico
            for _retry in xrange(10):
                dbi.sync()
                normPath, normQuery = normalizeQuery(path, query, remove=('signature', 'timestamp'), separate=True)
                ak.used(request.remote_addr, normPath, normQuery, not onlyPublic)
                try:
                    dbi.endRequest(True)
                except ConflictError:
                    pass  # retry
                else:
                    break
        else:
            # No need to commit stuff if we didn't use an API key
            # (nothing was written)
            dbi.endRequest(False)

        LDAPConnector.destroy()

        # Log successful POST api requests
        if error is None and request.method == 'POST':
            logger.info('API request: %s?%s' % (path, query))

        serializer = Serializer.create(dformat, query_params=queryParams, pretty=pretty, typeMap=typeMap,
                                       **hook.serializer_args)
        if error:
            if not serializer.schemaless:
                # if our serializer has a specific schema (HTML, ICAL, etc...)
                # use JSON, since it is universal
                serializer = Serializer.create('json')

            result = fossilize(error)
        else: