cobweb-launcher 1.2.51__tar.gz → 1.2.52__tar.gz
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 cobweb-launcher might be problematic. Click here for more details.
- {cobweb-launcher-1.2.51/cobweb_launcher.egg-info → cobweb-launcher-1.2.52}/PKG-INFO +1 -1
- {cobweb-launcher-1.2.51 → cobweb-launcher-1.2.52}/cobweb/db/redis_db.py +40 -18
- {cobweb-launcher-1.2.51 → cobweb-launcher-1.2.52/cobweb_launcher.egg-info}/PKG-INFO +1 -1
- {cobweb-launcher-1.2.51 → cobweb-launcher-1.2.52}/setup.py +1 -1
- {cobweb-launcher-1.2.51 → cobweb-launcher-1.2.52}/LICENSE +0 -0
- {cobweb-launcher-1.2.51 → cobweb-launcher-1.2.52}/README.md +0 -0
- {cobweb-launcher-1.2.51 → cobweb-launcher-1.2.52}/cobweb/__init__.py +0 -0
- {cobweb-launcher-1.2.51 → cobweb-launcher-1.2.52}/cobweb/base/__init__.py +0 -0
- {cobweb-launcher-1.2.51 → cobweb-launcher-1.2.52}/cobweb/base/common_queue.py +0 -0
- {cobweb-launcher-1.2.51 → cobweb-launcher-1.2.52}/cobweb/base/decorators.py +0 -0
- {cobweb-launcher-1.2.51 → cobweb-launcher-1.2.52}/cobweb/base/item.py +0 -0
- {cobweb-launcher-1.2.51 → cobweb-launcher-1.2.52}/cobweb/base/log.py +0 -0
- {cobweb-launcher-1.2.51 → cobweb-launcher-1.2.52}/cobweb/base/request.py +0 -0
- {cobweb-launcher-1.2.51 → cobweb-launcher-1.2.52}/cobweb/base/response.py +0 -0
- {cobweb-launcher-1.2.51 → cobweb-launcher-1.2.52}/cobweb/base/seed.py +0 -0
- {cobweb-launcher-1.2.51 → cobweb-launcher-1.2.52}/cobweb/constant.py +0 -0
- {cobweb-launcher-1.2.51 → cobweb-launcher-1.2.52}/cobweb/crawlers/__init__.py +0 -0
- {cobweb-launcher-1.2.51 → cobweb-launcher-1.2.52}/cobweb/crawlers/base_crawler.py +0 -0
- {cobweb-launcher-1.2.51 → cobweb-launcher-1.2.52}/cobweb/crawlers/crawler.py +0 -0
- {cobweb-launcher-1.2.51 → cobweb-launcher-1.2.52}/cobweb/crawlers/file_crawler.py +0 -0
- {cobweb-launcher-1.2.51 → cobweb-launcher-1.2.52}/cobweb/db/__init__.py +0 -0
- {cobweb-launcher-1.2.51 → cobweb-launcher-1.2.52}/cobweb/db/api_db.py +0 -0
- {cobweb-launcher-1.2.51 → cobweb-launcher-1.2.52}/cobweb/exceptions/__init__.py +0 -0
- {cobweb-launcher-1.2.51 → cobweb-launcher-1.2.52}/cobweb/exceptions/oss_db_exception.py +0 -0
- {cobweb-launcher-1.2.51 → cobweb-launcher-1.2.52}/cobweb/launchers/__init__.py +0 -0
- {cobweb-launcher-1.2.51 → cobweb-launcher-1.2.52}/cobweb/launchers/launcher.py +0 -0
- {cobweb-launcher-1.2.51 → cobweb-launcher-1.2.52}/cobweb/launchers/launcher_air.py +0 -0
- {cobweb-launcher-1.2.51 → cobweb-launcher-1.2.52}/cobweb/launchers/launcher_api.py +0 -0
- {cobweb-launcher-1.2.51 → cobweb-launcher-1.2.52}/cobweb/launchers/launcher_pro.py +0 -0
- {cobweb-launcher-1.2.51 → cobweb-launcher-1.2.52}/cobweb/pipelines/__init__.py +0 -0
- {cobweb-launcher-1.2.51 → cobweb-launcher-1.2.52}/cobweb/pipelines/pipeline.py +0 -0
- {cobweb-launcher-1.2.51 → cobweb-launcher-1.2.52}/cobweb/pipelines/pipeline_console.py +0 -0
- {cobweb-launcher-1.2.51 → cobweb-launcher-1.2.52}/cobweb/pipelines/pipeline_loghub.py +0 -0
- {cobweb-launcher-1.2.51 → cobweb-launcher-1.2.52}/cobweb/setting.py +0 -0
- {cobweb-launcher-1.2.51 → cobweb-launcher-1.2.52}/cobweb/utils/__init__.py +0 -0
- {cobweb-launcher-1.2.51 → cobweb-launcher-1.2.52}/cobweb/utils/bloom.py +0 -0
- {cobweb-launcher-1.2.51 → cobweb-launcher-1.2.52}/cobweb/utils/dotting.py +0 -0
- {cobweb-launcher-1.2.51 → cobweb-launcher-1.2.52}/cobweb/utils/oss.py +0 -0
- {cobweb-launcher-1.2.51 → cobweb-launcher-1.2.52}/cobweb/utils/tools.py +0 -0
- {cobweb-launcher-1.2.51 → cobweb-launcher-1.2.52}/cobweb_launcher.egg-info/SOURCES.txt +0 -0
- {cobweb-launcher-1.2.51 → cobweb-launcher-1.2.52}/cobweb_launcher.egg-info/dependency_links.txt +0 -0
- {cobweb-launcher-1.2.51 → cobweb-launcher-1.2.52}/cobweb_launcher.egg-info/requires.txt +0 -0
- {cobweb-launcher-1.2.51 → cobweb-launcher-1.2.52}/cobweb_launcher.egg-info/top_level.txt +0 -0
- {cobweb-launcher-1.2.51 → cobweb-launcher-1.2.52}/setup.cfg +0 -0
- {cobweb-launcher-1.2.51 → cobweb-launcher-1.2.52}/test/test.py +0 -0
|
@@ -6,60 +6,82 @@ class RedisDB:
|
|
|
6
6
|
|
|
7
7
|
def __init__(self, **kwargs):
|
|
8
8
|
redis_config = kwargs or setting.REDIS_CONFIG
|
|
9
|
-
pool = redis.ConnectionPool(**redis_config)
|
|
10
|
-
self.
|
|
9
|
+
# pool = redis.ConnectionPool(**redis_config)
|
|
10
|
+
self.pool = redis.ConnectionPool(
|
|
11
|
+
max_connections=25,
|
|
12
|
+
**redis_config
|
|
13
|
+
)
|
|
14
|
+
|
|
15
|
+
def get_connection(self):
|
|
16
|
+
return redis.StrictRedis(connection_pool=self.pool)
|
|
17
|
+
# self._client = redis.Redis(connection_pool=pool)
|
|
11
18
|
|
|
12
19
|
def setnx(self, name, value=""):
|
|
13
|
-
|
|
20
|
+
with self.get_connection() as client:
|
|
21
|
+
client.setnx(name, value)
|
|
14
22
|
|
|
15
23
|
def setex(self, name, t, value=""):
|
|
16
|
-
|
|
24
|
+
with self.get_connection() as client:
|
|
25
|
+
client.setex(name, t, value)
|
|
17
26
|
|
|
18
27
|
def expire(self, name, t, nx: bool = False, xx: bool = False, gt: bool = False, lt: bool = False):
|
|
19
|
-
|
|
28
|
+
with self.get_connection() as client:
|
|
29
|
+
client.expire(name, t, nx, xx, gt, lt)
|
|
20
30
|
|
|
21
31
|
def ttl(self, name):
|
|
22
|
-
|
|
32
|
+
with self.get_connection() as client:
|
|
33
|
+
return client.ttl(name)
|
|
23
34
|
|
|
24
35
|
def delete(self, name):
|
|
25
|
-
|
|
36
|
+
with self.get_connection() as client:
|
|
37
|
+
return client.delete(name)
|
|
26
38
|
|
|
27
39
|
def exists(self, *name) -> bool:
|
|
28
|
-
|
|
40
|
+
with self.get_connection() as client:
|
|
41
|
+
return client.exists(*name)
|
|
29
42
|
|
|
30
43
|
def sadd(self, name, value):
|
|
31
|
-
|
|
44
|
+
with self.get_connection() as client:
|
|
45
|
+
return client.sadd(name, value)
|
|
32
46
|
|
|
33
47
|
def zcard(self, name) -> bool:
|
|
34
|
-
|
|
48
|
+
with self.get_connection() as client:
|
|
49
|
+
return client.zcard(name)
|
|
35
50
|
|
|
36
51
|
def zadd(self, name, item: dict, **kwargs):
|
|
37
|
-
|
|
52
|
+
with self.get_connection() as client:
|
|
53
|
+
return client.zadd(name, item, **kwargs)
|
|
38
54
|
|
|
39
55
|
def zrem(self, name, *value):
|
|
40
|
-
|
|
56
|
+
with self.get_connection() as client:
|
|
57
|
+
return client.zrem(name, *value)
|
|
41
58
|
|
|
42
59
|
def zcount(self, name, _min, _max):
|
|
43
|
-
|
|
60
|
+
with self.get_connection() as client:
|
|
61
|
+
return client.zcount(name, _min, _max)
|
|
44
62
|
|
|
45
63
|
# def zrangebyscore(self, name, _min, _max, start, num, withscores: bool = False, *args):
|
|
46
|
-
#
|
|
64
|
+
# with self.get_connection() as client:
|
|
65
|
+
# return client.zrangebyscore(name, _min, _max, start, num, withscores, *args)
|
|
47
66
|
|
|
48
67
|
def lua(self, script: str, keys: list = None, args: list = None):
|
|
49
68
|
keys = keys or []
|
|
50
69
|
args = args or []
|
|
51
70
|
keys_count = len(keys)
|
|
52
|
-
|
|
71
|
+
with self.get_connection() as client:
|
|
72
|
+
return client.eval(script, keys_count, *keys, *args)
|
|
53
73
|
|
|
54
74
|
def lua_sha(self, sha1: str, keys: list = None, args: list = None):
|
|
55
75
|
keys = keys or []
|
|
56
76
|
args = args or []
|
|
57
77
|
keys_count = len(keys)
|
|
58
|
-
|
|
78
|
+
with self.get_connection() as client:
|
|
79
|
+
return client.evalsha(sha1, keys_count, *keys, *args)
|
|
59
80
|
|
|
60
81
|
def execute_lua(self, lua_script: str, keys: list, *args):
|
|
61
|
-
|
|
62
|
-
|
|
82
|
+
with self.get_connection() as client:
|
|
83
|
+
execute = client.register_script(lua_script)
|
|
84
|
+
return execute(keys=keys, args=args)
|
|
63
85
|
|
|
64
86
|
def lock(self, key, t=15) -> bool:
|
|
65
87
|
lua_script = """
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cobweb-launcher-1.2.51 → cobweb-launcher-1.2.52}/cobweb_launcher.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|