From 21ea9856ee8dc5c7d1f7c306aa0f61c028c41be8 Mon Sep 17 00:00:00 2001 From: Nemo Date: Thu, 12 Jan 2023 15:53:46 +0530 Subject: [PATCH] add cache --- .github/workflows/update.yml | 1 + update.py | 6 ------ 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/update.yml b/.github/workflows/update.yml index 37f86b7..e3b2ceb 100644 --- a/.github/workflows/update.yml +++ b/.github/workflows/update.yml @@ -18,6 +18,7 @@ jobs: - uses: actions/setup-python@v4 with: python-version: '3.10' + cache: 'pip' - name: Update data run: | pip install -r requirements.txt diff --git a/update.py b/update.py index d7eb8fc..dcc1318 100644 --- a/update.py +++ b/update.py @@ -49,7 +49,6 @@ def get_url_slug(kb_id): except urllib.error.HTTPError as response: if 'location' in response.headers: l = response.headers['location'] - print(l) return l.split('/')[-1] else: return None @@ -66,18 +65,13 @@ def update_mapping(kb_ids): for kb_id in kb_ids: i=i+1 if kb_id not in kb: - print(kb_id) slug = get_url_slug(kb_id) if slug: - print(slug) new_data = parse_redirect(kb_id, slug) - print(new_data) if new_data: updated = True kb[kb_id] = new_data print(f"Status: {i}/{len(kb_ids)}") - else: - print("no slug") if updated: with open('data.json', 'w') as f: