mns-common 1.3.6.7__py3-none-any.whl → 1.3.6.8__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.

@@ -38,27 +38,31 @@ def check_valid(str_now_date, ip_proxy_pool):
38
38
 
39
39
 
40
40
  def generate_proxy_ip(minutes):
41
- query = {"type": "liu_guan_proxy", }
42
- stock_account_info = mongodb_util.find_query_data(db_name_constant.STOCK_ACCOUNT_INFO, query)
43
- order_id = list(stock_account_info['password'])[0]
44
- secret = list(stock_account_info['account'])[0]
41
+ ip_proxy_pool = mongodb_util.find_all_data(db_name_constant.IP_PROXY_POOL)
42
+ if data_frame_util.is_not_empty(ip_proxy_pool):
43
+ return list(ip_proxy_pool['ip'])[0]
44
+ else:
45
+ query = {"type": "liu_guan_proxy", }
46
+ stock_account_info = mongodb_util.find_query_data(db_name_constant.STOCK_ACCOUNT_INFO, query)
47
+ order_id = list(stock_account_info['password'])[0]
48
+ secret = list(stock_account_info['account'])[0]
45
49
 
46
- now_date = datetime.datetime.now()
47
- time_to_add = datetime.timedelta(minutes=minutes - 1, seconds=40)
48
- new_date = now_date + time_to_add
49
- str_now_date = new_date.strftime('%Y-%m-%d %H:%M:%S')
50
+ now_date = datetime.datetime.now()
51
+ time_to_add = datetime.timedelta(minutes=minutes - 1, seconds=40)
52
+ new_date = now_date + time_to_add
53
+ str_now_date = new_date.strftime('%Y-%m-%d %H:%M:%S')
50
54
 
51
- # 获取10分钟动态ip
52
- ip = liu_guan_proxy_api.get_proxy_api(order_id, secret, str(60 * minutes))
55
+ # 获取10分钟动态ip
56
+ ip = liu_guan_proxy_api.get_proxy_api(order_id, secret, str(60 * minutes))
53
57
 
54
- result_dict = {"_id": ip,
55
- 'effect_time': str_now_date,
56
- 'ip': ip}
57
- result_df = pd.DataFrame(result_dict, index=[1])
58
+ result_dict = {"_id": ip,
59
+ 'effect_time': str_now_date,
60
+ 'ip': ip}
61
+ result_df = pd.DataFrame(result_dict, index=[1])
58
62
 
59
- mongodb_util.insert_mongo(result_df, db_name_constant.IP_PROXY_POOL)
63
+ mongodb_util.insert_mongo(result_df, db_name_constant.IP_PROXY_POOL)
60
64
 
61
- return ip
65
+ return ip
62
66
 
63
67
 
64
68
  def get_proxy_ip(str_now_date, minutes):
@@ -1,4 +1,4 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: mns-common
3
- Version: 1.3.6.7
3
+ Version: 1.3.6.8
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=iwog6S6GWUw9lkOD6ElJCtAWu94G6LiQFUJRK05jGUc,2529
110
+ mns_common/component/proxies/proxy_common_api.py,sha256=d9MNnsSfMEBp3NQoB1lviGgf24_8l9W57CyVbGd9nto,2782
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.7.dist-info/METADATA,sha256=8aczAilXQ9eekBt3UnPgyXNexhuqtAsBK415LtSVI2w,61
150
- mns_common-1.3.6.7.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
151
- mns_common-1.3.6.7.dist-info/top_level.txt,sha256=ZC58kAR-8Hvc6U2xhYNBNLAh3mb6sZazbdj5nZpvEkQ,11
152
- mns_common-1.3.6.7.dist-info/RECORD,,
149
+ mns_common-1.3.6.8.dist-info/METADATA,sha256=1DxXAd0H9QKJkJxKwFfERSzcIfVtafpNnQ74xWUAabg,61
150
+ mns_common-1.3.6.8.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
151
+ mns_common-1.3.6.8.dist-info/top_level.txt,sha256=ZC58kAR-8Hvc6U2xhYNBNLAh3mb6sZazbdj5nZpvEkQ,11
152
+ mns_common-1.3.6.8.dist-info/RECORD,,