예제 #1
0
파일: worker.py 프로젝트: x0rzkov/aleph
    def periodic(self):
        db.session.remove()
        if self.hourly.check():
            self.hourly.update()
            log.info("Running hourly tasks...")
            compute_collections()
            check_alerts()

        if self.daily.check():
            self.daily.update()
            log.info("Running daily tasks...")
            generate_digest()
            update_roles()
예제 #2
0
파일: worker.py 프로젝트: wayne9qiu/aleph
    def run_often(self):
        log.info("Self-check...")
        self.cleanup_jobs()
        compute_collections()

        if self.hourly.check():
            self.hourly.update()
            log.info("Running hourly tasks...")
            check_alerts()

        if self.daily.check():
            self.daily.update()
            log.info("Running daily tasks...")
            generate_digest()
            update_roles()
예제 #3
0
파일: worker.py 프로젝트: moreymat/aleph
    def periodic(self):
        with app.app_context():
            db.session.remove()
            if self.often.check():
                self.often.update()
                log.info("Self-check...")
                self.cleanup_jobs()
                compute_collections()

            if self.daily.check():
                self.daily.update()
                log.info("Running daily tasks...")
                check_alerts()
                generate_digest()
                update_roles()
                delete_expired_exports()
예제 #4
0
파일: test_base_api.py 프로젝트: sunu/aleph
    def test_statistics(self):
        res = self.client.get("/api/2/statistics")
        assert res.status_code == 200, res
        assert "things" not in res.json, res.json

        self.load_fixtures()
        compute_collections()
        res = self.client.get("/api/2/statistics")
        assert res.status_code == 200, res
        assert res.json["collections"] == 1, res.json
        assert res.json["things"] == 1, res.json

        _, headers = self.login(is_admin=True)
        res = self.client.get("/api/2/statistics", headers=headers)
        assert res.status_code == 200, res
        assert res.json["collections"] == 1, res.json
        assert res.json["things"] == 1, res.json