|
@@ -34,7 +34,6 @@ from earwigbot.tasks import BaseTask |
|
|
|
|
|
|
|
|
__all__ = ["Task"] |
|
|
__all__ = ["Task"] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Task(BaseTask): |
|
|
class Task(BaseTask): |
|
|
"""A task to generate statistics for WikiProject Articles for Creation. |
|
|
"""A task to generate statistics for WikiProject Articles for Creation. |
|
|
|
|
|
|
|
@@ -86,10 +85,10 @@ class Task(BaseTask): |
|
|
local database. |
|
|
local database. |
|
|
""" |
|
|
""" |
|
|
action = kwargs.get("action") |
|
|
action = kwargs.get("action") |
|
|
if not self.db_access_lock.acquire(blocking=False): |
|
|
|
|
|
|
|
|
if not self.db_access_lock.acquire(False): # Non-blocking |
|
|
if action == "sync": |
|
|
if action == "sync": |
|
|
return |
|
|
return |
|
|
self.db_access_lock.acquire(blocking=True) |
|
|
|
|
|
|
|
|
self.db_access_lock.acquire() |
|
|
|
|
|
|
|
|
try: |
|
|
try: |
|
|
self.site = self.bot.wiki.get_site() |
|
|
self.site = self.bot.wiki.get_site() |
|
|