-
-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move purge scheduler to schedulers directory
- Loading branch information
1 parent
905311e
commit 21e9da9
Showing
2 changed files
with
16 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import os | ||
import shutil | ||
|
||
from config import Config | ||
from core.logger import Logger | ||
from core.scheduler import Scheduler, CronTrigger | ||
|
||
|
||
@Scheduler.scheduled_job(CronTrigger.from_crontab('0 0 * * *')) | ||
async def _(): | ||
cache_path = os.path.abspath(Config('cache_path')) | ||
Logger.info('Start purging cache...') | ||
if os.path.exists(cache_path): | ||
shutil.rmtree(cache_path) | ||
os.mkdir(cache_path) |