-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlocalWorker.py
41 lines (33 loc) · 977 Bytes
/
localWorker.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/py/bin/env python
from redis import Redis
from rq import Worker
# Preload libraries
from distutils.log import error
from xmlrpc.client import DateTime
import helpers
import numpy
from random import randint as rand, sample as sample
from redis import Redis
from rq import Worker
from time import sleep
from secret import dbPwd, agentList
import mysql.connector
from mysql.connector import errorcode
import requests
import time
from bs4 import BeautifulSoup as bs
import random
from MySQLdb import _mysql
import datetime
import os
from constants import SAMPLE_SIZE
import redis
from helpers import dbOperations
from redis import Redis
from rq import Queue, Connection
# url = urlparse(os.environ.get("REDIS_URL"))
# conn = redis.Redis(host=url.hostname, port=url.port, password=url.password, ssl=True, ssl_cert_reqs=None)
# print(url)
# Provide the worker with the list of queues (str) to listen to.
w = Worker(['default', 'high', 'low'], connection=Redis())
w.work()