示例#1
0
    def sync_data(self):
        candidates = stream_cache.get("candidates")
        LOGGER.info("Found {} candidates in cache".format(len(candidates)))

        params = self.get_params(_next=None)
        for i, candidate in enumerate(candidates):
            LOGGER.info("Fetching offers for candidate {} of {}".format(
                i + 1, len(candidates)))
            candidate_id = candidate["id"]
            url = self.get_url(candidate_id)
            resources = self.sync_paginated(url, params)
示例#2
0
    def sync_data(self):
        opportunities = stream_cache.get("opportunities")
        LOGGER.info("Found {} opportunities in cache".format(
            len(opportunities)))

        params = self.get_params(_next=None)
        for i, opportunity in enumerate(opportunities):
            LOGGER.info("Fetching offers for opportunity {} of {}".format(
                i + 1, len(opportunities)))
            opportunity_id = opportunity["id"]
            url = self.get_url(opportunity_id)
            resources = self.sync_paginated(url, params)
示例#3
0
    def sync_data(self):
        candidates = stream_cache.get("candidates")
        LOGGER.info("Found {} candidates in cache".format(len(candidates)))

        for i, candidate in enumerate(candidates):
            LOGGER.info(
                "Fetching resumes for candidate {} of {}".format(i + 1, len(candidates))
            )
            candidate_id = candidate["id"]
            url = self.get_url(candidate_id)
            try:
                resources = self.sync_paginated(url)
            except RuntimeError as e:
                # There's a bug in the Lever API where a missing resume will result
                # in a ResourceNotFound error instead of returning an empty response
                if "ResourceNotFound" in str(e):
                    LOGGER.info("Candidate %s does not have resumes", candidate_id)
                else:
                    raise