Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
converse.js
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
converse.js
Commits
6ed48be8
Commit
6ed48be8
authored
Feb 15, 2013
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support for not doing hooks in background (for testing and debugging)
parent
3855cf92
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
6 deletions
+29
-6
docs/config.rst
docs/config.rst
+8
-0
weblate/settings_example.py
weblate/settings_example.py
+3
-0
weblate/trans/api.py
weblate/trans/api.py
+15
-6
weblate/trans/appsettings.py
weblate/trans/appsettings.py
+3
-0
No files found.
docs/config.rst
View file @
6ed48be8
...
@@ -50,6 +50,14 @@ Time in seconds for how long the automatic lock for translation will be active.
...
@@ -50,6 +50,14 @@ Time in seconds for how long the automatic lock for translation will be active.
.. seealso:: :ref:`locking`
.. seealso:: :ref:`locking`
.. setting:: BACKGROUND_HOOKS
BACKGROUND_HOOKS
----------------
Whether to run hooks in background. This is generally recommended unless you
are debugging.
.. setting:: CHECK_LIST
.. setting:: CHECK_LIST
CHECK_LIST
CHECK_LIST
...
...
weblate/settings_example.py
View file @
6ed48be8
...
@@ -306,6 +306,9 @@ EMAIL_SUBJECT_PREFIX = '[%s] ' % SITE_TITLE
...
@@ -306,6 +306,9 @@ EMAIL_SUBJECT_PREFIX = '[%s] ' % SITE_TITLE
# Enable remote hooks
# Enable remote hooks
ENABLE_HOOKS
=
True
ENABLE_HOOKS
=
True
# Whether to run hooks in background
BACKGROUND_HOOKS
=
True
# Number of nearby messages to show in each direction
# Number of nearby messages to show in each direction
NEARBY_MESSAGES
=
5
NEARBY_MESSAGES
=
5
...
...
weblate/trans/api.py
View file @
6ed48be8
...
@@ -43,8 +43,11 @@ def update_subproject(request, project, subproject):
...
@@ -43,8 +43,11 @@ def update_subproject(request, project, subproject):
if
not
appsettings
.
ENABLE_HOOKS
:
if
not
appsettings
.
ENABLE_HOOKS
:
return
HttpResponseNotAllowed
([])
return
HttpResponseNotAllowed
([])
obj
=
get_object_or_404
(
SubProject
,
slug
=
subproject
,
project__slug
=
project
)
obj
=
get_object_or_404
(
SubProject
,
slug
=
subproject
,
project__slug
=
project
)
thread
=
threading
.
Thread
(
target
=
obj
.
do_update
)
if
appsettings
.
BACKGROUND_HOOKS
:
thread
.
start
()
thread
=
threading
.
Thread
(
target
=
obj
.
do_update
)
thread
.
start
()
else
:
obj
.
do_update
()
return
HttpResponse
(
'update triggered'
)
return
HttpResponse
(
'update triggered'
)
...
@@ -56,8 +59,11 @@ def update_project(request, project):
...
@@ -56,8 +59,11 @@ def update_project(request, project):
if
not
appsettings
.
ENABLE_HOOKS
:
if
not
appsettings
.
ENABLE_HOOKS
:
return
HttpResponseNotAllowed
([])
return
HttpResponseNotAllowed
([])
obj
=
get_object_or_404
(
Project
,
slug
=
project
)
obj
=
get_object_or_404
(
Project
,
slug
=
project
)
thread
=
threading
.
Thread
(
target
=
obj
.
do_update
)
if
appsettings
.
BACKGROUND_HOOKS
:
thread
.
start
()
thread
=
threading
.
Thread
(
target
=
obj
.
do_update
)
thread
.
start
()
else
:
obj
.
do_update
()
return
HttpResponse
(
'update triggered'
)
return
HttpResponse
(
'update triggered'
)
...
@@ -96,8 +102,11 @@ def git_service_hook(request, service):
...
@@ -96,8 +102,11 @@ def git_service_hook(request, service):
)
)
for
obj
in
SubProject
.
objects
.
filter
(
repo
=
repo
,
branch
=
branch
):
for
obj
in
SubProject
.
objects
.
filter
(
repo
=
repo
,
branch
=
branch
):
logger
.
info
(
'%s notification will update %s'
,
obj
)
logger
.
info
(
'%s notification will update %s'
,
obj
)
thread
=
threading
.
Thread
(
target
=
obj
.
do_update
)
if
appsettings
.
BACKGROUND_HOOKS
:
thread
.
start
()
thread
=
threading
.
Thread
(
target
=
obj
.
do_update
)
thread
.
start
()
else
:
obj
.
do_update
()
return
HttpResponse
(
'update triggered'
)
return
HttpResponse
(
'update triggered'
)
...
...
weblate/trans/appsettings.py
View file @
6ed48be8
...
@@ -53,6 +53,9 @@ OFFER_HOSTING = get('OFFER_HOSTING', False)
...
@@ -53,6 +53,9 @@ OFFER_HOSTING = get('OFFER_HOSTING', False)
# Enable remote hooks
# Enable remote hooks
ENABLE_HOOKS
=
get
(
'ENABLE_HOOKS'
,
True
)
ENABLE_HOOKS
=
get
(
'ENABLE_HOOKS'
,
True
)
# Whether to run hooks in background
BACKGROUND_HOOKS
=
get
(
'BACKGROUND_HOOKS'
,
True
)
# Number of nearby messages to show in each direction
# Number of nearby messages to show in each direction
NEARBY_MESSAGES
=
get
(
'NEARBY_MESSAGES'
,
5
)
NEARBY_MESSAGES
=
get
(
'NEARBY_MESSAGES'
,
5
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment