|
@@ -10,6 +10,10 @@ from argparse import ArgumentParser
|
|
|
|
|
|
from applications import PQMySQL, DeNetMysql, longArticlesMySQL
|
|
|
from applications.const import updateAccountReadAvgTaskConst
|
|
|
+from config import apolloConfig
|
|
|
+
|
|
|
+config = apolloConfig()
|
|
|
+unauthorized_account = json.loads(config.getConfigValue("unauthed_account_fans"))
|
|
|
|
|
|
|
|
|
def get_account_fans_by_dt(db_client) -> dict:
|
|
@@ -125,10 +129,12 @@ class UpdateAccountInfoVersion3(object):
|
|
|
fans_dict = get_account_fans_by_dt(db_client=self.de)
|
|
|
account_list = self.get_publishing_accounts()
|
|
|
rate_dict = self.get_account_position_read_rate(dt)
|
|
|
- for account in tqdm(account_list):
|
|
|
+ for account in tqdm(account_list, desc=dt):
|
|
|
business_type = self.const.TOULIU if account[
|
|
|
'gh_id'] in self.const.TOULIU_ACCOUNTS else self.const.ARTICLES_DAILY
|
|
|
fans = fans_dict.get(account['gh_id'], {}).get(dt, 0)
|
|
|
+ if not fans:
|
|
|
+ fans = int(unauthorized_account.get(account['account_name'], 0))
|
|
|
if fans:
|
|
|
for index in range(1, 9):
|
|
|
gh_id_position = "{}_{}".format(account['gh_id'], index)
|