def parseRedisPageIndustryOverview(): dbConn = getDBConn('ibbd2') redisConn = getRedisConn() toDate = date.today() - timedelta(2) fromDate = toDate - timedelta(15) # start schedule_info(dbConn, redisConn) page_index(dbConn, redisConn) page_industry_overview_saletrend(dbConn, redisConn, fromDate, toDate) page_industry_overview_pricetrend(dbConn, redisConn, fromDate, toDate) page_industry_hotregion(dbConn, redisConn, fromDate, toDate) page_industry_overview(dbConn, redisConn, fromDate, toDate) page_industry_catsales(dbConn, redisConn, fromDate, toDate) redisConn.set('ibbd-ststc-date', (toDate + timedelta(1)).strftime('%Y/%m/%d')) # end dbConn.close() del redisConn del dbConn
def main(): spiderLog2('Redis', 'GBSAVE', 'Start') redis = getRedisConn() redis.bgsave() spiderLog2('Redis', 'BGSAVE', 'Success')