Subversion Repositories SmartDukaan

Rev

Rev 5984 | Rev 13500 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 5984 Rev 13493
Line 1... Line 1...
1
#!/usr/bin/python
1
#!/usr/bin/python
2
import sys
2
import sys
-
 
3
import ast
3
 
4
 
4
if __name__ == '__main__' and __package__ is None:
5
if __name__ == '__main__' and __package__ is None:
5
    import os
6
    import os
6
    sys.path.insert(0, os.getcwd())
7
    sys.path.insert(0, os.getcwd())
7
 
8
 
8
from shop2020.clients.InventoryClient import InventoryClient
9
from shop2020.clients.InventoryClient import InventoryClient
9
 
10
 
10
def notify():
11
def notify():
-
 
12
    f = open('/catalog-dumps/catalog-items')
-
 
13
    itemids = f.readline()
-
 
14
    f.close()
-
 
15
    if len(itemids) == 0:
-
 
16
        continue
-
 
17
    else:
-
 
18
        itemids = [int(itemid)for itemid in itemids.split(",")]
11
    client = InventoryClient().get_client()
19
        client = InventoryClient().get_client()
12
    client.clearItemAvailabilityCache()
20
        client.clearItemAvailabilityCache(itemids)
13
    print "Item availability cache cleared."
21
        print "Item availability cache cleared."
14
            
22
            
15
def main():
23
def main():
16
    notify()
24
    notify()
17
 
25
 
18
if __name__ == '__main__':
26
if __name__ == '__main__':