Subversion Repositories SmartDukaan

Rev

Rev 13503 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 13503 Rev 13521
Line 7... Line 7...
7
    sys.path.insert(0, os.getcwd())
7
    sys.path.insert(0, os.getcwd())
8
 
8
 
9
from shop2020.clients.InventoryClient import InventoryClient
9
from shop2020.clients.InventoryClient import InventoryClient
10
 
10
 
11
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
        return
-
 
17
    else:
12
 
18
        itemids = [int(itemid)for itemid in itemids.split(",")]
-
 
19
        client = InventoryClient().get_client()
13
    client = InventoryClient().get_client()
20
        client.clearItemAvailabilityCache(itemids)
14
    client.clearItemAvailabilityCache()
21
        print "Item availability cache cleared."
15
    print "Item availability cache cleared."
22
            
16
            
23
def main():
17
def main():
24
    notify()
18
    notify()
25
 
19
 
26
if __name__ == '__main__':
20
if __name__ == '__main__':