Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
website
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
Jannik Hellenkamp
website
Commits
40459a09
Unverified
Commit
40459a09
authored
6 years ago
by
Andreas Valder
Browse files
Options
Downloads
Patches
Plain Diff
throw exception if the video hash missmatches and log exceptions to mail
parent
50ac6417
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
jobmanagement.py
+2
-1
2 additions, 1 deletion
jobmanagement.py
sorter.py
+1
-2
1 addition, 2 deletions
sorter.py
with
3 additions
and
3 deletions
jobmanagement.py
+
2
−
1
View file @
40459a09
from
server
import
modify
,
query
,
date_json_handler
,
sched_func
from
server
import
modify
,
query
,
date_json_handler
,
sched_func
,
notify_admins
from
datetime
import
datetime
,
timedelta
import
traceback
import
json
...
...
@@ -22,6 +22,7 @@ def job_handler_handle(id, state):
try
:
func
(
id
,
job
[
'
type
'
],
json
.
loads
(
job
[
'
data
'
]),
state
,
json
.
loads
(
job
[
'
status
'
]))
except
Exception
:
notify_admins
(
'
scheduler_exception
'
,
name
=
func
.
__name__
,
traceback
=
traceback
.
format_exc
())
traceback
.
print_exc
()
@sched_func
(
10
)
...
...
This diff is collapsed.
Click to expand it.
sorter.py
+
1
−
2
View file @
40459a09
...
...
@@ -35,8 +35,7 @@ def update_video_metadata(jobid, jobtype, data, state, status):
if
jobtype
not
in
[
'
remux
'
,
'
transcode
'
]:
video
=
query
(
'
SELECT * FROM videos WHERE id = ?
'
,
data
[
'
video_id
'
])[
0
]
if
video
[
'
hash
'
]
and
video
[
'
hash
'
]
!=
status
[
'
hash
'
]:
print
(
'
Hash mismatch for video
'
,
data
[
'
video_id
'
])
return
raise
Exception
(
'
Hash mismatch for video {}
'
.
format
(
data
[
'
video_id
'
]))
modify
(
'
UPDATE videos_data SET hash = ?, file_size = ?, duration = ? WHERE id = ?
'
,
status
[
'
hash
'
],
status
[
'
filesize
'
],
status
[
'
duration
'
],
data
[
'
video_id
'
])
...
...
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