1
0
Fork 0
mirror of https://github.com/Findus23/acronomy.git synced 2024-09-19 15:33:45 +02:00

fix wikipedia fetch

This commit is contained in:
Lukas Winkler 2023-03-21 23:30:07 +01:00
parent 188c566eae
commit e2e214449d
Signed by: lukas
GPG key ID: 54DE4D798D244853

View file

@ -1,6 +1,8 @@
import time
from datetime import timedelta
from django.core.management.base import BaseCommand
from django.utils import timezone
from acros.models import WikipediaLink
@ -11,10 +13,12 @@ class Command(BaseCommand):
def handle(self, *args, **options):
links = WikipediaLink.objects.all()
for link in links:
print(link)
self.stdout.write(link.title)
if link.timestamp >= (timezone.now() - timedelta(days=180)):
print("skipped")
continue
link.fetched = False
# update_change_reason(link, "refetch_wikipedia command")
link.clean()
link.save()
time.sleep(1)
time.sleep(3)