2021-05-14 15:49:04 +00:00
|
|
|
from nest_backend.database import *
|
2021-05-26 21:20:40 +00:00
|
|
|
from nest_backend.app import app, extension_sqlalchemy
|
2021-05-28 10:57:11 +00:00
|
|
|
from nest_crawler.repo_search import search_repo_conditions
|
2021-05-27 09:21:51 +00:00
|
|
|
from alert_trigger import is_repo_alert_triggered
|
2021-05-14 15:49:04 +00:00
|
|
|
|
|
|
|
ext.init_app(app=app)
|
|
|
|
|
|
|
|
|
2021-05-26 21:20:40 +00:00
|
|
|
def search_all_repo():
|
|
|
|
active_repos = Repository.query.filter_by(is_active=True)
|
|
|
|
for repo_id in [active_repo.id for active_repo in active_repos]:
|
2021-05-27 09:21:51 +00:00
|
|
|
#search_repo_conditions(repo_id)
|
2021-05-26 21:20:40 +00:00
|
|
|
is_repo_alert_triggered(repo_id)
|
|
|
|
|
2021-05-14 15:49:04 +00:00
|
|
|
if __name__ == "__main__":
|
|
|
|
with app.app_context():
|
2021-05-26 21:20:40 +00:00
|
|
|
search_all_repo()
|
|
|
|
|
|
|
|
|