simo 2.5.7__py3-none-any.whl → 2.5.8__py3-none-any.whl
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 simo might be problematic. Click here for more details.
- simo/core/management/_hub_template/hub/supervisor.conf +2 -8
- simo/core/tasks.py +30 -1
- {simo-2.5.7.dist-info → simo-2.5.8.dist-info}/METADATA +1 -1
- {simo-2.5.7.dist-info → simo-2.5.8.dist-info}/RECORD +8 -8
- {simo-2.5.7.dist-info → simo-2.5.8.dist-info}/LICENSE.md +0 -0
- {simo-2.5.7.dist-info → simo-2.5.8.dist-info}/WHEEL +0 -0
- {simo-2.5.7.dist-info → simo-2.5.8.dist-info}/entry_points.txt +0 -0
- {simo-2.5.7.dist-info → simo-2.5.8.dist-info}/top_level.txt +0 -0
|
@@ -10,7 +10,6 @@ stdout_logfile_backups=3
|
|
|
10
10
|
redirect_stderr=true
|
|
11
11
|
autostart=true
|
|
12
12
|
autorestart=false
|
|
13
|
-
stopsignal=INT
|
|
14
13
|
stopwaitsecs=15
|
|
15
14
|
killasgroup=true
|
|
16
15
|
|
|
@@ -18,7 +17,7 @@ killasgroup=true
|
|
|
18
17
|
# using gunicorn for regular requests
|
|
19
18
|
[program:simo-gunicorn]
|
|
20
19
|
directory={{ project_dir }}/hub/
|
|
21
|
-
command={{ venv_path }}/gunicorn --workers
|
|
20
|
+
command={{ venv_path }}/gunicorn --workers 2 --timeout 120 --bind unix:/tmp/gunicorn.sock wsgi:application
|
|
22
21
|
process_name=%(program_name)s
|
|
23
22
|
user=root
|
|
24
23
|
stdout_logfile=/var/log/simo/gunicorn.log
|
|
@@ -27,7 +26,6 @@ stdout_logfile_backups=3
|
|
|
27
26
|
redirect_stderr=true
|
|
28
27
|
autostart=true
|
|
29
28
|
autorestart=true
|
|
30
|
-
stopsignal=INT
|
|
31
29
|
stopwaitsecs=15
|
|
32
30
|
killasgroup=true
|
|
33
31
|
|
|
@@ -44,7 +42,6 @@ stdout_logfile_backups=3
|
|
|
44
42
|
redirect_stderr=true
|
|
45
43
|
autostart=true
|
|
46
44
|
autorestart=true
|
|
47
|
-
stopsignal=INT
|
|
48
45
|
stopwaitsecs=15
|
|
49
46
|
killasgroup=true
|
|
50
47
|
|
|
@@ -61,7 +58,6 @@ stdout_logfile_backups=3
|
|
|
61
58
|
redirect_stderr=true
|
|
62
59
|
autostart=true
|
|
63
60
|
autorestart=true
|
|
64
|
-
stopsignal=INT
|
|
65
61
|
stopwaitsecs=15
|
|
66
62
|
killasgroup=true
|
|
67
63
|
|
|
@@ -77,7 +73,6 @@ stdout_logfile_backups=3
|
|
|
77
73
|
redirect_stderr=true
|
|
78
74
|
autostart=true
|
|
79
75
|
autorestart=true
|
|
80
|
-
stopsignal=INT
|
|
81
76
|
stopwaitsecs=15
|
|
82
77
|
killasgroup=true
|
|
83
78
|
|
|
@@ -93,6 +88,5 @@ stdout_logfile_backups=3
|
|
|
93
88
|
redirect_stderr=true
|
|
94
89
|
autostart=true
|
|
95
90
|
autorestart=true
|
|
96
|
-
stopsignal=INT
|
|
97
91
|
stopwaitsecs=15
|
|
98
|
-
killasgroup=
|
|
92
|
+
killasgroup=false
|
simo/core/tasks.py
CHANGED
|
@@ -270,18 +270,46 @@ def sync_with_remote():
|
|
|
270
270
|
@celery_app.task
|
|
271
271
|
def clear_history():
|
|
272
272
|
for instance in Instance.objects.all():
|
|
273
|
+
print(f"Clear history of {instance}")
|
|
273
274
|
old_times = timezone.now() - datetime.timedelta(
|
|
274
275
|
days=instance.history_days
|
|
275
276
|
)
|
|
276
277
|
ComponentHistory.objects.filter(
|
|
277
278
|
component__zone__instance=instance, date__lt=old_times
|
|
278
279
|
).delete()
|
|
280
|
+
i = 0
|
|
281
|
+
delete_ids = []
|
|
282
|
+
for obj in ComponentHistory.objects.filter(
|
|
283
|
+
component__zone__instance=instance
|
|
284
|
+
).order_by('-date').values('id').iterator():
|
|
285
|
+
if i < 5000:
|
|
286
|
+
continue
|
|
287
|
+
delete_ids.append(obj['id'])
|
|
288
|
+
ComponentHistory.objects.filter(id__in=delete_ids)
|
|
279
289
|
HistoryAggregate.objects.filter(
|
|
280
290
|
component__zone__instance=instance, start__lt=old_times
|
|
281
291
|
).delete()
|
|
292
|
+
i = 0
|
|
293
|
+
delete_ids = []
|
|
294
|
+
for obj in HistoryAggregate.objects.filter(
|
|
295
|
+
component__zone__instance=instance
|
|
296
|
+
).order_by('-start').values('id').iterator():
|
|
297
|
+
if i < 1000:
|
|
298
|
+
continue
|
|
299
|
+
delete_ids.append(obj['id'])
|
|
300
|
+
HistoryAggregate.objects.filter(id__in=delete_ids)
|
|
282
301
|
Action.objects.filter(
|
|
283
302
|
data__instance_id=instance.id, timestamp__lt=old_times
|
|
284
303
|
)
|
|
304
|
+
i = 0
|
|
305
|
+
delete_ids = []
|
|
306
|
+
for obj in Action.objects.filter(
|
|
307
|
+
data__instance_id=instance.id
|
|
308
|
+
).order_by('-timestamp').values('id').iterator():
|
|
309
|
+
if i < 5000:
|
|
310
|
+
continue
|
|
311
|
+
delete_ids.append(obj['id'])
|
|
312
|
+
Action.objects.filter(id__in=delete_ids)
|
|
285
313
|
|
|
286
314
|
|
|
287
315
|
@celery_app.task
|
|
@@ -343,6 +371,7 @@ def update():
|
|
|
343
371
|
@celery_app.task
|
|
344
372
|
def drop_fingerprints_learn():
|
|
345
373
|
Instance.objects.filter(
|
|
374
|
+
is_active=True,
|
|
346
375
|
learn_fingerprints__isnull=False,
|
|
347
376
|
learn_fingerprints_start__lt=timezone.now() - datetime.timedelta(minutes=5)
|
|
348
377
|
).update(
|
|
@@ -376,7 +405,7 @@ def restart_postgresql():
|
|
|
376
405
|
def low_battery_notifications():
|
|
377
406
|
from simo.users.models import User
|
|
378
407
|
from simo.notifications.utils import notify_users
|
|
379
|
-
for instance in Instance.objects.
|
|
408
|
+
for instance in Instance.objects.filter(is_active=True):
|
|
380
409
|
timezone.activate(instance.timezone)
|
|
381
410
|
if timezone.localtime().hour != 10:
|
|
382
411
|
continue
|
|
@@ -59,7 +59,7 @@ simo/core/serializers.py,sha256=Pa2lhJ6VgNalbH4awbKdGJCYAPNsu5WQWfo6Tz6LbOQ,2078
|
|
|
59
59
|
simo/core/signal_receivers.py,sha256=qCpzEUv5Bl9--K8fe08GVDmE6EBOj292YBia1TYDdSE,9267
|
|
60
60
|
simo/core/socket_consumers.py,sha256=trRZvBGTJ7xIbfdmVvn7zoiWp_qssSkMZykDrI5YQyE,9783
|
|
61
61
|
simo/core/storage.py,sha256=_5igjaoWZAiExGWFEJMElxUw55DzJG1jqFty33xe8BE,342
|
|
62
|
-
simo/core/tasks.py,sha256=
|
|
62
|
+
simo/core/tasks.py,sha256=6Srcsq1szv7pU74Qp-Y4GUoRjvNPJI81jKsSWxqVcb8,15671
|
|
63
63
|
simo/core/todos.py,sha256=eYVXfLGiapkxKK57XuviSNe3WsUYyIWZ0hgQJk7ThKo,665
|
|
64
64
|
simo/core/types.py,sha256=WJEq48mIbFi_5Alt4wxWMGXxNxUTXqfQU5koH7wqHHI,1108
|
|
65
65
|
simo/core/views.py,sha256=3SRZr00fyLQf8ja3U-9eekKt-ld5TvU1WQqUWprXfQ4,2390
|
|
@@ -153,7 +153,7 @@ simo/core/management/_hub_template/hub/celeryc.py,sha256=3ksDXftIZKJ4Cq9WNKJERdZ
|
|
|
153
153
|
simo/core/management/_hub_template/hub/manage.py,sha256=PNNlw3EVeIJDgkG0l-klqoxsKWfTYWG9jzRG0upmAaI,620
|
|
154
154
|
simo/core/management/_hub_template/hub/nginx.conf,sha256=40hvXL42MeiqqkLURNcDQsRudv1dNFLJnvb2-Y3RCkk,2394
|
|
155
155
|
simo/core/management/_hub_template/hub/settings.py,sha256=4QhvhbtLRxHvAntwqG_qeAAtpDUqKvN4jzw9u3vqff8,361
|
|
156
|
-
simo/core/management/_hub_template/hub/supervisor.conf,sha256=
|
|
156
|
+
simo/core/management/_hub_template/hub/supervisor.conf,sha256=7oqtr3p8rUervmwdfMNdscpPPCTLCFgrn2W_ak7g0yk,2362
|
|
157
157
|
simo/core/management/_hub_template/hub/urls.py,sha256=Ydm-1BkYAzWeEF-MKSDIFf-7aE4qNLPm48-SA51XgJQ,25
|
|
158
158
|
simo/core/management/_hub_template/hub/wsgi.py,sha256=Lo-huLHnMDTxSmMBOodVFMWBls9poddrV2KRzXU0xGo,280
|
|
159
159
|
simo/core/management/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -10551,9 +10551,9 @@ simo/users/templates/invitations/expired_msg.html,sha256=47DEQpj8HBSa-_TImW-5JCe
|
|
|
10551
10551
|
simo/users/templates/invitations/expired_suggestion.html,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
10552
10552
|
simo/users/templates/invitations/taken_msg.html,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
10553
10553
|
simo/users/templates/invitations/taken_suggestion.html,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
10554
|
-
simo-2.5.
|
|
10555
|
-
simo-2.5.
|
|
10556
|
-
simo-2.5.
|
|
10557
|
-
simo-2.5.
|
|
10558
|
-
simo-2.5.
|
|
10559
|
-
simo-2.5.
|
|
10554
|
+
simo-2.5.8.dist-info/LICENSE.md,sha256=M7wm1EmMGDtwPRdg7kW4d00h1uAXjKOT3HFScYQMeiE,34916
|
|
10555
|
+
simo-2.5.8.dist-info/METADATA,sha256=MS1IN9xaTOEDIMAGVtan3qT0-ejhkz04LhraYddcASA,1923
|
|
10556
|
+
simo-2.5.8.dist-info/WHEEL,sha256=P9jw-gEje8ByB7_hXoICnHtVCrEwMQh-630tKvQWehc,91
|
|
10557
|
+
simo-2.5.8.dist-info/entry_points.txt,sha256=S9PwnUYmTSW7681GKDCxUbL0leRJIaRk6fDQIKgbZBA,135
|
|
10558
|
+
simo-2.5.8.dist-info/top_level.txt,sha256=GmS1hrAbpVqn9OWZh6UX82eIOdRLgYA82RG9fe8v4Rs,5
|
|
10559
|
+
simo-2.5.8.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|