File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change 2
2
table and SQLite files) for a single given date."""
3
3
import sys
4
4
from util .sqlite_util import clear_cache_for_date
5
+ from datetime import timedelta
5
6
from dateutil import parser
6
7
7
8
from parameters .local_parameters import path
15
16
print ("Attempting to clear the SQLite cache for date = {}" .format (date_i ))
16
17
clear_cache_for_date (path ,reference_time ,date_i )
17
18
print ("SQLite cache cleared for {}" .format (date_i ))
19
+ elif len (sys .argv ) == 3 :
20
+ first_dt = parser .parse (sys .argv [1 ])
21
+ first_date_i = first_dt .date ()
22
+ last_dt = parser .parse (sys .argv [2 ])
23
+ last_date_i = last_dt .date ()
24
+ print ("Attempting to clear the SQLite cache for dates {} through {}" .format (first_date_i ,last_date_i ))
25
+ date_i = first_date_i
26
+ while date_i <= last_date_i :
27
+ clear_cache_for_date (path ,reference_time ,date_i )
28
+ print (" SQLite cache cleared for {}" .format (date_i ))
29
+ date_i += timedelta (days = 1 )
30
+ print ("SQLite cache cleared for {} through {}" .format (first_date_i ,last_date_i ))
18
31
else :
19
32
raise ValueError ("Incorrect number of command-line parameters found." )
You can’t perform that action at this time.
0 commit comments