Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mffzoom
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
wizards
mffzoom
Commits
ce855508
Commit
ce855508
authored
5 years ago
by
Martin Mareš
Browse files
Options
Downloads
Patches
Plain Diff
Hook: Debugging
parent
c47a2d1c
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
TODO
+0
-3
0 additions, 3 deletions
TODO
hook.wsgi
+14
-10
14 additions, 10 deletions
hook.wsgi
with
14 additions
and
13 deletions
TODO
+
0
−
3
View file @
ce855508
...
...
@@ -3,9 +3,6 @@
- Reloading
- Ztlumit logování
- Trigger na "last modified" u meetingů
- zjistit, jak funguje type=3, například 673556078 (negenerují se
další instance, které mají stejné id, ale jiné uuid?)
- hooky na create/delete user
- přehlednější log
- type=1 ignorovat (nestěžovat si, že je unknown)
- indexy
This diff is collapsed.
Click to expand it.
hook.wsgi
+
14
−
10
View file @
ce855508
...
...
@@ -64,14 +64,14 @@ class HookApp:
def
create_schedule
(
self
,
mid
,
meeting_id
,
occurrence_id
,
occ
):
self
.
log
(
"
Meeting {meeting_id}.{occurrence_id}: Scheduling
"
)
self
.
log
(
f
"
Meeting
{
meeting_id
}
.
{
occurrence_id
}
: Scheduling
"
)
db_query
(
"""
INSERT INTO zoom_schedule
(mid, occurrence_id, start_time, duration)
VALUES (%s, %s, %s, %s)
"""
,
(
mid
,
occurrence_id
,
,
occurrence_id
,
parse_time
(
occ
[
'
start_time
'
]),
occ
[
'
duration
'
],
))
...
...
@@ -155,8 +155,8 @@ class HookApp:
if
"
duration
"
in
new
:
self
.
log
(
f
"
Meeting
{
meeting_id
}
.
{
occurrence_id
}
: Updating duration
"
)
db_query
(
"
UPDATE zoom_
meetings
SET duration=%s WHERE m
eeting_
id=%s AND
(
occurrence_id=%s
OR %s =
'
0
'
)
"
,
(
new
[
'
duration
'
],
m
eeting_id
,
occurrence_
id
,
occurrence_id
))
db_query
(
"
UPDATE zoom_
schedule
SET duration=%s WHERE mid=%s AND occurrence_id=%s
"
,
(
new
[
'
duration
'
],
mid
,
occurrence_id
))
def
update_meeting_single
(
self
,
mid
,
meeting_id
,
old
,
new
):
...
...
@@ -167,13 +167,12 @@ class HookApp:
def
update_meeting_all
(
self
,
mid
,
meeting_id
,
old
,
new
):
self
.
log
(
f
"
Meeting
{
meeting_id
}
: Updating all occurrences
"
)
if
"
occurrences
"
in
new
:
# So this will be a recurrent meeting, replace all occurrences
self
.
log
(
f
"
Meeting
{
meeting_id
}
: Replacing all occurrences
"
)
db_query
(
"
DELETE FROM zoom_schedule WHERE mid=%s
"
,
(
mid
,))
for
occ
in
meeting
[
"
occurrences
"
]:
self
.
create_schedule
(
mid
,
meeting_id
,
occ
[
"
occurrence_id
"
],
new
)
for
occ
in
new
[
"
occurrences
"
]:
self
.
create_schedule
(
mid
,
meeting_id
,
occ
[
"
occurrence_id
"
],
occ
)
elif
"
start_time
"
in
new
:
if
new
[
"
start_time
"
]
==
""
:
...
...
@@ -191,6 +190,11 @@ class HookApp:
db_query
(
"
UPDATE zoom_schedule SET start_time=%s WHERE mid=%s
"
,
(
parse_time
(
new
[
"
start_time
"
]),
mid
))
elif
"
occurrences
"
in
old
:
# Descheduling (this can happen when changing type 8 to type 3)
self
.
log
(
f
"
Meeting
{
meeting_id
}
: Descheduling
"
)
db_query
(
"
DELETE FROM zoom_schedule WHERE mid=%s
"
,
(
mid
,))
elif
"
duration
"
in
new
:
# This is just a schedule change
self
.
log
(
f
"
Meeting
{
meeting_id
}
.0: Rescheduling with new duration
"
)
...
...
@@ -211,7 +215,7 @@ class HookApp:
return
mid
=
meeting_row
.
mid
old_type
=
meeting_row
.
type
old_type
=
old
.
get
(
"
type
"
,
-
1
)
new_type
=
new
.
get
(
"
type
"
,
-
1
)
if
old_type
!=
new_type
:
self
.
log
(
f
"
Meeting
{
meeting_id
}
: Transmuting from from type
{
old_type
}
to
{
new_type
}
"
)
...
...
@@ -228,7 +232,7 @@ class HookApp:
scope
=
payload
.
get
(
"
scope
"
,
"
all
"
)
if
scope
==
"
single
"
:
self
.
update_meeting_single
(
mid
,
meeting_id
,
old
,
new
)
elif
scope
==
all
"
:
elif
scope
==
"
all
"
:
self
.
update_meeting_all
(
mid
,
meeting_id
,
old
,
new
)
else
:
self
.
log
(
f
"
Meeting
{
meeting_id
}
: Unsupported update scope
{
scope
}
"
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment