Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
513ba89e6d
@ -2,7 +2,6 @@
|
|||||||
from ops.mmongo import MongodbBase
|
from ops.mmongo import MongodbBase
|
||||||
import pdb
|
import pdb
|
||||||
|
|
||||||
|
|
||||||
# mongodb://10.10.5.4/taptap games
|
# mongodb://10.10.5.4/taptap games
|
||||||
|
|
||||||
# {
|
# {
|
||||||
@ -82,6 +81,7 @@ import datetime
|
|||||||
import sys
|
import sys
|
||||||
from bson.objectid import ObjectId
|
from bson.objectid import ObjectId
|
||||||
import json
|
import json
|
||||||
|
|
||||||
define_logger("/data/logs/ops/reptile2ss.log")
|
define_logger("/data/logs/ops/reptile2ss.log")
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
MONGOINFO = {'host': '10.10.5.6', 'port': 27017}
|
MONGOINFO = {'host': '10.10.5.6', 'port': 27017}
|
||||||
@ -93,7 +93,7 @@ conver_int = ('order', 'gameid', 'watch', 'reserve', 'sell', 'download', 'review
|
|||||||
class CollectMongo():
|
class CollectMongo():
|
||||||
def __init__(self, item):
|
def __init__(self, item):
|
||||||
self.url = "http://10.10.3.17:8992/querySql"
|
self.url = "http://10.10.3.17:8992/querySql"
|
||||||
self.api_secret = "GsFnzuKcNOFXsRJbDjV3avy67wTl8tyRD0t0b0VOFbQ285StWmkvT32gtQBVycXp"
|
self.api_secret = "n9H4R32ZcjtSeN89ljCY6ESzTmOlnwwnOB3r4YsggnP5M1AXLtKtiS4sS1KKLOEQ"
|
||||||
self.tga = FromTga(url=self.url, token=self.api_secret)
|
self.tga = FromTga(url=self.url, token=self.api_secret)
|
||||||
self.item = item
|
self.item = item
|
||||||
self.gameid = self.item.get('gameid')
|
self.gameid = self.item.get('gameid')
|
||||||
@ -168,20 +168,18 @@ def read_mongo(start_date, end_date):
|
|||||||
reptile_4_1['db'] = "taptap"
|
reptile_4_1['db'] = "taptap"
|
||||||
reptile_4_1['coll'] = "games"
|
reptile_4_1['coll'] = "games"
|
||||||
reptile_4_1['event_name'] = "reptile_4_1"
|
reptile_4_1['event_name'] = "reptile_4_1"
|
||||||
#reptile_4_1['gameid'] = 9999
|
# reptile_4_1['gameid'] = 9999
|
||||||
reptile_4_1['tgaid'] = 6
|
reptile_4_1['tgaid'] = 6
|
||||||
reptile_4_1['pipeline'] = [{'$match': {'createdAt': {'$gte': start_date, '$lt': end_date}}}, {
|
reptile_4_1['pipeline'] = [{'$match': {'createdAt': {'$gte': start_date, '$lt': end_date}}}, {
|
||||||
'$project': {'tags': 1, 'source': 1, 'cateName': 1, 'icon': 1, 'order': 1, 'title': 1, 'author': 1, 'score': 1,
|
'$project': {'tags': 1, 'source': 1, 'cateName': 1, 'icon': 1, 'order': 1, 'title': 1, 'author': 1, 'score': 1,
|
||||||
'desc': 1, 'cate': 1, 'gameid': 1, 'date': 1, 'watch': 1, 'reserve': 1, 'sell': 1, 'download': 1,
|
'cate': 1, 'gameid': 1, 'watch': 1, 'reserve': 1, 'sell': 1, 'download': 1,
|
||||||
'review': 1, 'topic': 1, 'createdAt': 1, 'updatedAt': 1, 'object_id': '$_id', '_id': 0}}]
|
'review': 1, 'topic': 1, 'createdAt': 1, 'updatedAt': 1, 'object_id': '$_id', '_id': 0}}]
|
||||||
all_type.append(reptile_4_1)
|
all_type.append(reptile_4_1)
|
||||||
for item in all_type:
|
for item in all_type:
|
||||||
cc = CollectMongo(item)
|
cc = CollectMongo(item)
|
||||||
cc.run()
|
cc.run()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
if len(sys.argv) == 2:
|
if len(sys.argv) == 2:
|
||||||
try:
|
try:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user