django-restit 4.2.139__py3-none-any.whl → 4.2.141__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- {django_restit-4.2.139.dist-info → django_restit-4.2.141.dist-info}/METADATA +1 -1
- {django_restit-4.2.139.dist-info → django_restit-4.2.141.dist-info}/RECORD +10 -10
- rest/__init__.py +1 -1
- rest/models/base.py +2 -1
- rest/rpc.py +1 -1
- taskqueue/worker.py +13 -1
- ws4redis/client.py +1 -1
- ws4redis/redis.py +12 -0
- {django_restit-4.2.139.dist-info → django_restit-4.2.141.dist-info}/LICENSE.md +0 -0
- {django_restit-4.2.139.dist-info → django_restit-4.2.141.dist-info}/WHEEL +0 -0
@@ -377,7 +377,7 @@ pushit/utils.py,sha256=IeTCGa-164nmB1jIsK1lu1O1QzUhS3BKfuXHGjCW-ck,2121
|
|
377
377
|
rest/.gitignore,sha256=TbEvWRMnAiajCTOdhiNrd9eeCAaIjRp9PRjE_VkMM5g,118
|
378
378
|
rest/README.md,sha256=V3ETc-cJu8PZIbKr9xSe_pA4JEUpC8Dhw4bQeVCDJPw,5460
|
379
379
|
rest/RemoteEvents.py,sha256=nL46U7AuxIrlw2JunphR1tsXyqi-ep_gD9CYGpYbNgE,72
|
380
|
-
rest/__init__.py,sha256=
|
380
|
+
rest/__init__.py,sha256=YC4So4Ejobln4uHaypwHTf7FfQPfOQA2E7VzAEIVpK0,122
|
381
381
|
rest/arc4.py,sha256=y644IbF1ec--e4cUJ3KEYsewTCITK0gmlwa5mJruFC0,1967
|
382
382
|
rest/cache.py,sha256=1Qg0rkaCJCaVP0-l5hZg2CIblTdeBSlj_0fP6vlKUpU,83
|
383
383
|
rest/crypto/__init__.py,sha256=Tl0U11rgj1eBYqd6OXJ2_XSdNLumW_JkBZnaJqI6Ldw,72
|
@@ -410,13 +410,13 @@ rest/middleware/request.py,sha256=JchRNy5L-bGd-7h-KFYekGRvREe2eCkZXKOYqIkP2hI,41
|
|
410
410
|
rest/middleware/session.py,sha256=zHSoQpIzRLmpqr_JvW406wzpvU3W3gDbm5JhtzLAMlE,10240
|
411
411
|
rest/middleware/session_store.py,sha256=1nSdeXK8PyuYgGgIufqrS6j6QpIrQ7zbMNT0ol75e6U,1901
|
412
412
|
rest/models/__init__.py,sha256=M8pvFDq-WCF-QcM58X7pMufYYe0aaQ3U0PwGe9TKbbY,130
|
413
|
-
rest/models/base.py,sha256=
|
413
|
+
rest/models/base.py,sha256=NTw7IHJu4wpJ3CwIDbYZnoDe8mbJ5B6quocAmyzzJ2c,71787
|
414
414
|
rest/models/cacher.py,sha256=eKz8TINVhWEqKhJGMsRkKZTtBUIv5rN3NHbZwOC56Uk,578
|
415
415
|
rest/models/metadata.py,sha256=1nQ7CYo9bJHoaXE_hVNaj1-Y7yqhHlf2ZlaD1IfTzic,12904
|
416
416
|
rest/net.py,sha256=LcB2QV6VNRtsSdmiQvYZgwQUDwOPMn_VBdRiZ6OpI-I,2974
|
417
417
|
rest/regexes.yaml,sha256=VoGb4E-P_K9f82Yzcpltgzekpt9usRtwu9PYlo46nUw,149463
|
418
418
|
rest/requestex.py,sha256=N56056vV3zWkAP-QrYsCu7SdpPzE5kLuPoxGIuZAKt0,16127
|
419
|
-
rest/rpc.py,sha256=
|
419
|
+
rest/rpc.py,sha256=fcOI84p8sK9MJBDRgjBwtPtylOTOZNUUhFmFtSSndB8,2919
|
420
420
|
rest/search.py,sha256=QVjk2b5tZLgf1zM2MHvJTyRjwUbY5ZD7HXSTmSPXtvU,8362
|
421
421
|
rest/serializers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
422
422
|
rest/serializers/collection.py,sha256=V9O4qxw26VX9dSYdbsN0-RNnXEi347Ln8eFLZ003LhA,4646
|
@@ -469,7 +469,7 @@ taskqueue/transports/http.py,sha256=AzliUnw_LuyO2zZZOoUAJGFcTV-Gxt1iE3hCVnIiyGQ,
|
|
469
469
|
taskqueue/transports/s3.py,sha256=fMosL893u1iQdo6Y1djwb7KEoNo6TTsDPJl13OJdJP8,1913
|
470
470
|
taskqueue/transports/sftp.py,sha256=jT1_krjTHA7DCAukD85aGYRCg9m0cEH9EWzOC-wJGdk,1891
|
471
471
|
taskqueue/transports/sms.py,sha256=H1-LIGEMfbUNqJD9amRcsvKUSwtz9yBj1QNfB7EHjHE,142
|
472
|
-
taskqueue/worker.py,sha256=
|
472
|
+
taskqueue/worker.py,sha256=MFHj8P_Fdh_2BBKVDf0stF8TNgdQlEl6lg_f8lhRCIQ,16204
|
473
473
|
telephony/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
474
474
|
telephony/admin.py,sha256=iOdsBfFFbBisdqKSZ36bIrh_z5sU0Wx_PkaFi8wd1iA,243
|
475
475
|
telephony/decorators.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -502,10 +502,10 @@ wiki/rpc/wiki.py,sha256=RQY1gtqxdNhp13n3SkZL9WZ6RatrtCIh7QOYta6-UUU,1327
|
|
502
502
|
wiki/tq.py,sha256=wvuBZ3OMV_D2o4kpJhVLIOwpEUfwlglqLJQvpncAwtk,313
|
503
503
|
ws4redis/README.md,sha256=QvwdsauPKxx4qQqnJ991xeU8DgFQCj3CeQt-nCE4s-w,3624
|
504
504
|
ws4redis/__init__.py,sha256=teNfv83A_ke1CBt9BB7NsnWCcFBhnUFPsPESjF554_k,46
|
505
|
-
ws4redis/client.py,sha256=
|
505
|
+
ws4redis/client.py,sha256=HTntgqlMzZU9MhBz3fn3fXDpzfaTDZx_9tIb5SU91hY,7077
|
506
506
|
ws4redis/connection.py,sha256=rlzdmgyjmuqETxjNf3uZU3tfoBeQQTzD4ZFru_u3JAs,13738
|
507
507
|
ws4redis/exceptions.py,sha256=EGLoRTdqJVwz900pwhciqPuSjBBd08hhLgFu6umHrI4,636
|
508
|
-
ws4redis/redis.py,sha256=
|
508
|
+
ws4redis/redis.py,sha256=fTNKrXPelowZrgji1XaijUoeQepV1ab1_Y3_tHsysww,6511
|
509
509
|
ws4redis/servers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
510
510
|
ws4redis/servers/base.py,sha256=3nYZF5jSsQxNLbnLtKLFJ82xJs_Mc7N1H2kEOx8wT6o,3747
|
511
511
|
ws4redis/servers/django.py,sha256=cKOE4U0cE8I3_rDaLgv-KuDb376RASdOzUn7MlDA4As,5900
|
@@ -513,7 +513,7 @@ ws4redis/servers/uwsgi.py,sha256=VyhoCI1DnVFqBiJYHoxqn5Idlf6uJPHvfBKgkjs34mo,172
|
|
513
513
|
ws4redis/settings.py,sha256=KKq00EwoGnz1yLwCZr5Dfoq2izivmAdsNEEM4EhZwN4,1610
|
514
514
|
ws4redis/utf8validator.py,sha256=S0OlfjeGRP75aO6CzZsF4oTjRQAgR17OWE9rgZdMBZA,5122
|
515
515
|
ws4redis/websocket.py,sha256=R0TUyPsoVRD7Y_oU7w2I6NL4fPwiz5Vl94-fUkZgLHA,14848
|
516
|
-
django_restit-4.2.
|
517
|
-
django_restit-4.2.
|
518
|
-
django_restit-4.2.
|
519
|
-
django_restit-4.2.
|
516
|
+
django_restit-4.2.141.dist-info/LICENSE.md,sha256=VHN4hhEeVOoFjtG-5fVv4jesA4SWi0Z-KgOzzN6a1ps,1068
|
517
|
+
django_restit-4.2.141.dist-info/METADATA,sha256=Y15h9tAP-SaF2niw_d4c0qKCW_aCAcHDJca7xzY4ivk,7663
|
518
|
+
django_restit-4.2.141.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
519
|
+
django_restit-4.2.141.dist-info/RECORD,,
|
rest/__init__.py
CHANGED
rest/models/base.py
CHANGED
@@ -1004,6 +1004,7 @@ class RestModel(object):
|
|
1004
1004
|
def on_rest_date_filter(cls, request, qset=None):
|
1005
1005
|
dr_start = request.DATA.get("dr_start", field_type=datetime)
|
1006
1006
|
dr_end = request.DATA.get("dr_end", field_type=datetime)
|
1007
|
+
dr_end_str = request.DATA.get("dr_end")
|
1007
1008
|
tr_start = request.DATA.get("tr_start")
|
1008
1009
|
tr_end = request.DATA.get("tr_end")
|
1009
1010
|
dr_offset = request.DATA.get("dr_offset", 0, field_type=int)
|
@@ -1021,7 +1022,7 @@ class RestModel(object):
|
|
1021
1022
|
dr_end = datetime.now() + timedelta(hours=5)
|
1022
1023
|
elif dr_end == dr_start and not tr_end:
|
1023
1024
|
dr_end = dr_start + timedelta(days=1)
|
1024
|
-
elif
|
1025
|
+
elif "-" in dr_end_str or "/" in dr_end_str:
|
1025
1026
|
dr_end = dr_end + timedelta(days=1)
|
1026
1027
|
|
1027
1028
|
if tr_start is not None:
|
rest/rpc.py
CHANGED
@@ -58,7 +58,7 @@ def on_get_status(request):
|
|
58
58
|
flag = redis.ping()
|
59
59
|
except Exception:
|
60
60
|
flag = False
|
61
|
-
status = dict(redis=flag, database={})
|
61
|
+
status = dict(redis=flag, database={}, pool=redis.getPoolStatus())
|
62
62
|
for alias in settings.DATABASES.keys():
|
63
63
|
db_conn = connections[alias]
|
64
64
|
try:
|
taskqueue/worker.py
CHANGED
@@ -5,18 +5,29 @@ from concurrent import futures
|
|
5
5
|
|
6
6
|
from redis import ConnectionPool, StrictRedis
|
7
7
|
from ws4redis import settings as ws4redis_settings
|
8
|
+
from objict import nobjict, objict
|
8
9
|
|
9
10
|
redis_connection_pool = ConnectionPool(**ws4redis_settings.WS4REDIS_CONNECTION)
|
10
11
|
|
12
|
+
|
11
13
|
def getRedisClient():
|
12
14
|
return StrictRedis(connection_pool=redis_connection_pool)
|
13
15
|
|
16
|
+
|
17
|
+
def getPoolStatus():
|
18
|
+
status = objict()
|
19
|
+
status.max_size = redis_connection_pool.max_connections
|
20
|
+
status.size = redis_connection_pool._created_connections
|
21
|
+
status.in_use = len(redis_connection_pool._in_use_connections)
|
22
|
+
status.available = len(redis_connection_pool._available_connections)
|
23
|
+
return status
|
24
|
+
|
25
|
+
|
14
26
|
from .models import redis, Task, TASK_STATE_STARTED
|
15
27
|
from .transports import email, http, sftp, sms, s3
|
16
28
|
from rest import helpers
|
17
29
|
from rest.log import getLogger
|
18
30
|
from rest import settings
|
19
|
-
from objict import nobjict
|
20
31
|
from datetime import datetime, timedelta
|
21
32
|
import time
|
22
33
|
|
@@ -238,6 +249,7 @@ class WorkManager(object):
|
|
238
249
|
data.running = self._running_count
|
239
250
|
data.pending = self._pending_count
|
240
251
|
data.scheduled = len(self._scheduled_tasks.keys())
|
252
|
+
data.pool = dict(**getPoolStatus())
|
241
253
|
redis.publish(event.data.response_channel, data)
|
242
254
|
|
243
255
|
def on_task_started(self, task):
|
ws4redis/client.py
CHANGED
@@ -2,7 +2,7 @@ import time
|
|
2
2
|
|
3
3
|
from rest import UberDict
|
4
4
|
|
5
|
-
from ws4redis.redis import RedisMessage, RedisStore, getRedisClient
|
5
|
+
from ws4redis.redis import RedisMessage, RedisStore, getRedisClient, getPoolStatus
|
6
6
|
|
7
7
|
|
8
8
|
def buildEventMessage(name=None, message=None, priority=0, model=None, model_pk=None, custom=None):
|
ws4redis/redis.py
CHANGED
@@ -17,6 +17,18 @@ def getRedisClient():
|
|
17
17
|
return StrictRedis(connection_pool=REDIS_CON_POOL)
|
18
18
|
|
19
19
|
|
20
|
+
# Function to check the number of connections in use and available
|
21
|
+
def getPoolStatus():
|
22
|
+
status = UberDict()
|
23
|
+
if REDIS_CON_POOL is None:
|
24
|
+
return status
|
25
|
+
status.max_size = REDIS_CON_POOL.max_connections
|
26
|
+
status.size = REDIS_CON_POOL._created_connections
|
27
|
+
status.in_use = len(REDIS_CON_POOL._in_use_connections)
|
28
|
+
status.available = len(REDIS_CON_POOL._available_connections)
|
29
|
+
return status
|
30
|
+
|
31
|
+
|
20
32
|
class RedisMessage(bytes):
|
21
33
|
def __new__(cls, value):
|
22
34
|
if isinstance(value, str):
|
File without changes
|
File without changes
|