mns-common 1.3.6.4__py3-none-any.whl → 1.3.6.6__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of mns-common might be problematic. Click here for more details.

@@ -37,19 +37,19 @@ def check_valid(str_now_date, ip_proxy_pool):
37
37
  return False
38
38
 
39
39
 
40
- def generate_proxy_ip():
40
+ def generate_proxy_ip(minutes):
41
41
  query = {"type": "liu_guan_proxy", }
42
42
  stock_account_info = mongodb_util.find_query_data(db_name_constant.STOCK_ACCOUNT_INFO, query)
43
43
  order_id = list(stock_account_info['password'])[0]
44
44
  secret = list(stock_account_info['account'])[0]
45
45
 
46
46
  now_date = datetime.datetime.now()
47
- time_to_add = datetime.timedelta(minutes=9, seconds=40)
47
+ time_to_add = datetime.timedelta(minutes=minutes)
48
48
  new_date = now_date + time_to_add
49
49
  str_now_date = new_date.strftime('%Y-%m-%d %H:%M:%S')
50
50
 
51
51
  # 获取10分钟动态ip
52
- ip = liu_guan_proxy_api.get_proxy_api(order_id, secret, '600')
52
+ ip = liu_guan_proxy_api.get_proxy_api(order_id, secret, str(60 * minutes))
53
53
 
54
54
  result_dict = {"_id": ip,
55
55
  'effect_time': str_now_date,
@@ -61,15 +61,15 @@ def generate_proxy_ip():
61
61
  return ip
62
62
 
63
63
 
64
- def get_proxy_ip(str_now_date):
64
+ def get_proxy_ip(str_now_date, minutes):
65
65
  ip_proxy_pool = query_liu_guan_proxy_ip()
66
66
  if data_frame_util.is_empty(ip_proxy_pool):
67
- return generate_proxy_ip()
67
+ return generate_proxy_ip(minutes)
68
68
  else:
69
69
  if check_valid(str_now_date, ip_proxy_pool):
70
70
  return list(ip_proxy_pool['ip'])[0]
71
71
  else:
72
- return generate_proxy_ip()
72
+ return generate_proxy_ip(minutes)
73
73
 
74
74
 
75
75
  if __name__ == '__main__':
@@ -1,4 +1,4 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: mns-common
3
- Version: 1.3.6.4
3
+ Version: 1.3.6.6
4
4
 
@@ -107,7 +107,7 @@ mns_common/component/k_line/patterns/pattern_Enum.py,sha256=bl8cH1H3BWdj_deVO124
107
107
  mns_common/component/price/__init__.py,sha256=wEg73KlZo-dU0yKGwpA1C2y6LZm4IBb94tNda1tqLeg,163
108
108
  mns_common/component/price/trade_price_service_api.py,sha256=0loBjbOt__o-ngc2Q4n5lF8_0x2WINRpL-cH1341Uaw,4396
109
109
  mns_common/component/proxies/__init__.py,sha256=wEg73KlZo-dU0yKGwpA1C2y6LZm4IBb94tNda1tqLeg,163
110
- mns_common/component/proxies/proxy_common_api.py,sha256=OlTpafPX6xg-yIumUQlQE9KhhoCUd4FsFcDOknD5MX8,2477
110
+ mns_common/component/proxies/proxy_common_api.py,sha256=feKn7WqpJAWXrJ7dLfwwGNMkDx4ejAlxuBEYT9Fe0hY,2513
111
111
  mns_common/component/qmt/__init__.py,sha256=wEg73KlZo-dU0yKGwpA1C2y6LZm4IBb94tNda1tqLeg,163
112
112
  mns_common/component/qmt/qmt_buy_service.py,sha256=tLTgrSxCcxuMhADRBBrW4ZWR_3MdbMZvvMdH5hbwyJU,7190
113
113
  mns_common/component/real_time/__init__.py,sha256=2U9DiKslxsWwLLEcZKjS8UiQPN1QgALvnK3HiJNIZE0,163
@@ -146,7 +146,7 @@ mns_common/utils/date_handle_util.py,sha256=XS-MyA8_7k35LOCFAYOHgVcVkMft_Kc4Wa9U
146
146
  mns_common/utils/db_util.py,sha256=hSmfNAN4vEeEaUva6_cicZEhb2jSnib-Gvk2reke1vc,2590
147
147
  mns_common/utils/file_util.py,sha256=egWu6PenGPRp_ixrNTHKarT4dAnOT6FETR82EHUZJnQ,1042
148
148
  mns_common/utils/ip_util.py,sha256=UTcYfz_uytB__6nlBf7T-izuI7hi4XdB6ET0sJgEel4,969
149
- mns_common-1.3.6.4.dist-info/METADATA,sha256=GsYgCbbdHocFF4mV9ob3gK6DkdOhwhmK_kvlrrigCzA,61
150
- mns_common-1.3.6.4.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
151
- mns_common-1.3.6.4.dist-info/top_level.txt,sha256=ZC58kAR-8Hvc6U2xhYNBNLAh3mb6sZazbdj5nZpvEkQ,11
152
- mns_common-1.3.6.4.dist-info/RECORD,,
149
+ mns_common-1.3.6.6.dist-info/METADATA,sha256=edGSmpIS_eZWQzc2W2W1c-kYL8tsCz6mXfg0rkCLtwA,61
150
+ mns_common-1.3.6.6.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
151
+ mns_common-1.3.6.6.dist-info/top_level.txt,sha256=ZC58kAR-8Hvc6U2xhYNBNLAh3mb6sZazbdj5nZpvEkQ,11
152
+ mns_common-1.3.6.6.dist-info/RECORD,,