[TypeError: null is not an object (evaluating 'bleManager.start')]
npm start -- --reset-cache
), пробовал добавлять другие разрешения в файле AndroidManifest: <uses-feature android:name="android.hardware.bluetooth_le" android:required="true"/>
, <uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
bleManager.start(options, error => {
(236) бросает исключение, бывает ещё указывает на другой файл:readers = []
parsing_success = False
brwsr_prepare_success = False
r, w = Pipe(duplex=True)
readers.append(r)
p = Process(target=parsing_fnc, args=(w, config['parser']['interval'], config['parser']['attempts_max'], config['parser']['url'], config['parser']['keyword'], config['deamon']['parser']))
p.start()
w.close()
for i in range(browsers_count):
r2, w2 = Pipe(duplex=True)
readers.append(r2)
if(config['proxy']['enable']):
p2 = Process(target=executer_fnc, args=(w2, i+1, carts[i], users[i], payments[i], proxy_array[i], proxy_auth, config['deamon']['executer']))
else:
p2 = Process(target=executer_fnc, args=(w2, i+1, carts[i], users[i], payments[i], [], {}, config['deamon']['executer']))
p2.start()
w2.close()
while readers:
for r in wait(readers):
try:
msg = r.recv()
if(msg['action'] == "start_browser_prsr"):
parsing_success = True
if(msg['action'] == "error_conntection_prsr"):
print("error_conntection_prsr")
if(msg['action'] == "browser_prepare_success_ex"):
brwsr_prepare_success = True
if(msg['action'] == "success_buy_items"):
pass
# print("success_buy_items")
if(parsing_success & brwsr_prepare_success):
try:
r2.send({"action": "add_items_con"})
except BrokenPipeError as e:
pass
except EOFError:
readers.remove(r)
def executer_fnc(w, index, cart_param = {}, user_param = {}, payment_param = {}, proxy_param = [], proxy_auth_param = {}, deamon_param = {}):
# тут обработчик с action
if(len(proxy_param) > 0):
proxy = proxy_param
proxy_auth = proxy_auth_param
driver_tmp = executer_prepare_fnc(w, index)
readers = []
readers.append(w)
while readers:
for r in wait(readers, timeout = 300):
try:
msg = r.recv()
except EOFError:
readers.remove(r)
else:
if(msg['action'] == "add_items_con"):
if(deamon_param['enable']):
while True:
t1 = datetime.strptime(deamon_param['start']['time'], '%H:%M:%S')
t2 = datetime.strptime(datetime.now().strftime('%H:%M:%S'), '%H:%M:%S')
if((datetime.now().strftime('%H:%M:%S') == deamon_param['start']['time']) | (t1 < t2)):
# action
add_buy(index, driver_tmp, cart_param, user_param, payment_param)
break
time.sleep(1)
else:
add_buy(index, driver_tmp, cart_param, user_param, payment_param)
w.send({"action":"success_buy_items"})
w.close()
readers.remove(r)
bs_print3("STATUS", f"BROWSER {index}", f"closed", "GREEN", "PURPLE", "WHITE")
pass
def parsing_fnc(w, interval_param, attempts_max_param, url_param, keyword_param, deamon_param = {}):
if(deamon_param['enable']):
while True:
t1 = datetime.strptime(deamon_param['start']['time'], '%H:%M:%S')
t2 = datetime.strptime(datetime.now().strftime('%H:%M:%S'), '%H:%M:%S')
if((datetime.now().strftime('%H:%M:%S') == deamon_param['start']['time']) | (t1 < t2)):
# action
parcer_event(w, interval_param, attempts_max_param, url_param, keyword_param)
break;
time.sleep(1)
else:
parcer_event(w, interval_param, attempts_max_param, url_param, keyword_param)
pass
from multiprocessing import Process, Pipe, current_process
from multiprocessing.connection import wait
def foo(w, i):
print("w -> 1234")
w.send("1234")
readers = []
readers.append(w)
while readers:
for r in wait(readers):
try:
msg = r.recv()
except EOFError:
print("w: error")
readers.remove(r)
else:
if(msg == "1234"):
w.send("4321")
print("1234 -> w -> 4321")
if(msg == "4321"):
print("4321 -> w")
print("w: close")
if __name__ == '__main__':
readers = []
r, w = Pipe(duplex=True)
readers.append(r)
p = Process(target=foo, args=(w, 1))
p.start()
w.close()
while readers:
for r in wait(readers):
try:
msg = r.recv()
if(msg == "1234"):
r.send("1234")
print("1234 -> r -> 1234")
if(msg == "4321"):
r.send("r: 4321")
print("4321 -> r -> 4321")
except EOFError:
print("r: error")
readers.remove(r)