Subversion Repositories SmartDukaan

Rev

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

Rev 20369 Rev 20675
Line 107... Line 107...
107
    """Fetch latest updated items across portals
107
    """Fetch latest updated items across portals
108
       and calculate max and min R-Nlc"""
108
       and calculate max and min R-Nlc"""
109
    offset= 0
109
    offset= 0
110
    while(True):
110
    while(True):
111
        print "Fetching records offset %d and limit %d" %(offset,300)
111
        print "Fetching records offset %d and limit %d" %(offset,300)
112
        topSkus = list(get_mongo_connection().Catalog.MasterData.find( {"$and":[{'updatedOn': { "$gt": to_java_date(now - timedelta(hours=1))} }, { 'source_id' : { "$in": SOURCE_MAP.values() } }] }).skip(offset).limit(300))
112
        topSkus = list(get_mongo_connection().Catalog.MasterData.find( {"$and":[{'updatedOn': { "$gt": to_java_date(now - timedelta(hours=1))} }, { 'source_id' : { "$in": SOURCE_MAP.values() }},{'category_id':{"$in":[3,5]}}] }).skip(offset).limit(300))
113
        if len((topSkus)) == 0:
113
        if len((topSkus)) == 0:
114
            break
114
            break
115
        #topSkus = collection.find( {'_id':664})
115
        #topSkus = collection.find( {'_id':664})
116
        for sku in topSkus:
116
        for sku in topSkus:
117
            """Fix this """
117
            """Fix this """
Line 592... Line 592...
592
    print "Add best seller points ", datetime.now()
592
    print "Add best seller points ", datetime.now()
593
    addBestSellerPoints()
593
    addBestSellerPoints()
594
    print "eliminate similar deals ", datetime.now()
594
    print "eliminate similar deals ", datetime.now()
595
    eliminateSimilarDeals()
595
    eliminateSimilarDeals()
596
    print "done ", datetime.now()
596
    print "done ", datetime.now()
597
    getSubCategoryRanking()
597
#     getSubCategoryRanking()
598
    if options.shuffle=='true':
598
#     if options.shuffle=='true':
599
        print "Shuffling products"
599
#         print "Shuffling products"
600
        shuffle()
600
#         shuffle()
601
    startBucketing()
601
#     startBucketing()
602
    print "Done with bucketing",datetime.now()
602
#     print "Done with bucketing",datetime.now()
603
    
603
    
604
 
604
 
605
 
605
 
606
if __name__=='__main__':
606
if __name__=='__main__':
607
    main()
607
    main()