django-restit 4.2.140__py3-none-any.whl → 4.2.142__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: django-restit
3
- Version: 4.2.140
3
+ Version: 4.2.142
4
4
  Summary: A Rest Framework for DJANGO
5
5
  License: MIT
6
6
  Author: Ian Starnes
@@ -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=yQq_7suWzN5e9qoX3OzN7p2okHfUo9n0Rp3W6ZvVR0s,122
380
+ rest/__init__.py,sha256=hlX0ysuPQS5x3bCShSkKyAOossCGUQyGZ4ReDK1NeLM,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
@@ -416,7 +416,7 @@ 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=xun-HuaEqm1Lwg-9Xm4Y2JwOf8wTdpoagHuIUNlqTlI,2891
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=wzp44fk6LX94MdrXLp_IJmWgutLCBKqoobk433OiLqw,15822
472
+ taskqueue/worker.py,sha256=1YBeTOziUBtgjtgjiwf5ULFrJAfizqxvHxgWomhgtWs,15655
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=kElPtVMVObLUXAfu32v_PHd0HyygrW-ukk37_Tuo7ZM,7062
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=IfT4p3bUtlqso9rryNliH9Ebzlx8-Q2VJcs1kFioeGA,6093
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.140.dist-info/LICENSE.md,sha256=VHN4hhEeVOoFjtG-5fVv4jesA4SWi0Z-KgOzzN6a1ps,1068
517
- django_restit-4.2.140.dist-info/METADATA,sha256=GQO5bs9dpHrS_uY2j0m8maJ6xr5TiAKkn3F4Nh7A2eI,7663
518
- django_restit-4.2.140.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
519
- django_restit-4.2.140.dist-info/RECORD,,
516
+ django_restit-4.2.142.dist-info/LICENSE.md,sha256=VHN4hhEeVOoFjtG-5fVv4jesA4SWi0Z-KgOzzN6a1ps,1068
517
+ django_restit-4.2.142.dist-info/METADATA,sha256=ExBXdVbSrP8zJp7cm9D0SYaS6kTRjQXDmNdwHuzGviw,7663
518
+ django_restit-4.2.142.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
519
+ django_restit-4.2.142.dist-info/RECORD,,
rest/__init__.py CHANGED
@@ -1,4 +1,4 @@
1
1
  from .uberdict import UberDict # noqa: F401
2
2
  from .settings_helper import settings # noqa: F401
3
3
 
4
- __version__ = "4.2.140"
4
+ __version__ = "4.2.142"
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
@@ -1,23 +1,16 @@
1
-
2
- import requests
3
1
  import threading
4
2
  from concurrent import futures
5
3
 
6
- from redis import ConnectionPool, StrictRedis
7
- from ws4redis import settings as ws4redis_settings
8
-
9
- redis_connection_pool = ConnectionPool(**ws4redis_settings.WS4REDIS_CONNECTION)
4
+ # from redis import ConnectionPool, StrictRedis
5
+ from ws4redis.redis import getRedisClient, getPoolStatus
6
+ from objict import nobjict
10
7
 
11
- def getRedisClient():
12
- return StrictRedis(connection_pool=redis_connection_pool)
13
8
 
14
9
  from .models import redis, Task, TASK_STATE_STARTED
15
10
  from .transports import email, http, sftp, sms, s3
16
11
  from rest import helpers
17
12
  from rest.log import getLogger
18
13
  from rest import settings
19
- from objict import nobjict
20
- from datetime import datetime, timedelta
21
14
  import time
22
15
 
23
16
 
@@ -238,6 +231,7 @@ class WorkManager(object):
238
231
  data.running = self._running_count
239
232
  data.pending = self._pending_count
240
233
  data.scheduled = len(self._scheduled_tasks.keys())
234
+ data.pool = dict(**getPoolStatus())
241
235
  redis.publish(event.data.response_channel, data)
242
236
 
243
237
  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):