Subversion Repositories SmartDukaan

Rev

Rev 13500 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

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