mirror of
https://github.com/Findus23/acronomy.git
synced 2024-09-16 12:13:44 +02:00
fix wikipedia fetch
This commit is contained in:
parent
188c566eae
commit
e2e214449d
1 changed files with 6 additions and 2 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue