Subversion Repositories SmartDukaan

Rev

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

Rev 15342 Rev 15616
Line 19... Line 19...
19
 
19
 
20
(options, args) = parser.parse_args()
20
(options, args) = parser.parse_args()
21
 
21
 
22
mc = MemCache(options.mongoHost)
22
mc = MemCache(options.mongoHost)
23
 
23
 
-
 
24
ignoreItems = [475,476,477,478,4490,4491,10360,10361,14893, 23165, 8682]
-
 
25
 
24
def get_mongo_connection(host=options.mongoHost, port=27017):
26
def get_mongo_connection(host=options.mongoHost, port=27017):
25
    global con
27
    global con
26
    if con is None:
28
    if con is None:
27
        print "Establishing connection %s host and port %d" %(host,port)
29
        print "Establishing connection %s host and port %d" %(host,port)
28
        try:
30
        try:
Line 81... Line 83...
81
    dealScraping = False
83
    dealScraping = False
82
    print str(data['identifier'])
84
    print str(data['identifier'])
83
    if data['identifier'] is None or len(data['identifier'].strip())==0:
85
    if data['identifier'] is None or len(data['identifier'].strip())==0:
84
        return
86
        return
85
    
87
    
-
 
88
    if data['_id'] in ignoreItems:
-
 
89
        print "Ignored items returning for %d"%(data['_id'])
-
 
90
        return 
-
 
91
    
86
    try:
92
    try:
87
        if data['priceUpdatedOn'] > to_java_date(datetime.now() - timedelta(minutes=5)):
93
        if data['priceUpdatedOn'] > to_java_date(datetime.now() - timedelta(minutes=5)):
88
            print "sku id is already updated",data['_id'] 
94
            print "sku id is already updated",data['_id'] 
89
            return
95
            return
90
    except:
96
    except: