Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mutalyzer
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Analyze
Contributor analytics
CI/CD 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
Mirrors
mutalyzer
Commits
681bc10e
Commit
681bc10e
authored
9 years ago
by
Vermaat
Browse files
Options
Downloads
Plain Diff
Merge pull request #148 from mutalyzer/proc-name
Set process name for long-running processes
parents
1055d9a4
7795f431
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
mutalyzer/entrypoints/admin.py
+9
-0
9 additions, 0 deletions
mutalyzer/entrypoints/admin.py
mutalyzer/entrypoints/batch_processor.py
+5
-0
5 additions, 0 deletions
mutalyzer/entrypoints/batch_processor.py
mutalyzer/util.py
+13
-0
13 additions, 0 deletions
mutalyzer/util.py
with
27 additions
and
0 deletions
mutalyzer/entrypoints/admin.py
+
9
−
0
View file @
681bc10e
...
@@ -25,6 +25,7 @@ from ..db.models import Assembly, BatchJob, BatchQueueItem, Chromosome
...
@@ -25,6 +25,7 @@ from ..db.models import Assembly, BatchJob, BatchQueueItem, Chromosome
from
..
import
mapping
from
..
import
mapping
from
..
import
output
from
..
import
output
from
..
import
sync
from
..
import
sync
from
..
import
util
class
UserError
(
Exception
):
class
UserError
(
Exception
):
...
@@ -95,6 +96,10 @@ def import_mapview(assembly_name_or_alias, mapview_file, encoding,
...
@@ -95,6 +96,10 @@ def import_mapview(assembly_name_or_alias, mapview_file, encoding,
"""
"""
Import transcript mappings from an NCBI mapview file.
Import transcript mappings from an NCBI mapview file.
"""
"""
# For long-running processes it can be convenient to have a short and
# human-readable process name.
util
.
set_process_name
(
'
mutalyzer: mapview-import
'
)
mapview_file
=
codecs
.
getreader
(
encoding
)(
mapview_file
)
mapview_file
=
codecs
.
getreader
(
encoding
)(
mapview_file
)
try
:
try
:
...
@@ -144,6 +149,10 @@ def sync_cache(wsdl_url, url_template, history=7):
...
@@ -144,6 +149,10 @@ def sync_cache(wsdl_url, url_template, history=7):
25 5 * * * mutalyzer-cache-sync
'
http://dom1/?wsdl
'
'
http://dom1/{file}
'
-H 7
25 5 * * * mutalyzer-cache-sync
'
http://dom1/?wsdl
'
'
http://dom1/{file}
'
-H 7
55 5 * * * mutalyzer-cache-sync
'
http://dom2/?wsdl
'
'
http://dom2/{file}
'
-H 7
55 5 * * * mutalyzer-cache-sync
'
http://dom2/?wsdl
'
'
http://dom2/{file}
'
-H 7
"""
"""
# For long-running processes it can be convenient to have a short and
# human-readable process name.
util
.
set_process_name
(
'
mutalyzer: cache-sync
'
)
cache_sync
=
sync
.
CacheSync
(
output
.
Output
(
__file__
))
cache_sync
=
sync
.
CacheSync
(
output
.
Output
(
__file__
))
inserted
,
downloaded
=
cache_sync
.
sync_with_remote
(
wsdl_url
,
url_template
,
inserted
,
downloaded
=
cache_sync
.
sync_with_remote
(
wsdl_url
,
url_template
,
history
)
history
)
...
...
This diff is collapsed.
Click to expand it.
mutalyzer/entrypoints/batch_processor.py
+
5
−
0
View file @
681bc10e
...
@@ -15,12 +15,17 @@ import time
...
@@ -15,12 +15,17 @@ import time
from
..
import
db
from
..
import
db
from
..
import
Scheduler
from
..
import
Scheduler
from
..
import
util
def
process
():
def
process
():
"""
"""
Run forever in a loop processing scheduled batch jobs.
Run forever in a loop processing scheduled batch jobs.
"""
"""
# For long-running processes it can be convenient to have a short and
# human-readable process name.
util
.
set_process_name
(
'
mutalyzer: batch-processor
'
)
scheduler
=
Scheduler
.
Scheduler
()
scheduler
=
Scheduler
.
Scheduler
()
def
handle_exit
(
signum
,
stack_frame
):
def
handle_exit
(
signum
,
stack_frame
):
...
...
This diff is collapsed.
Click to expand it.
mutalyzer/util.py
+
13
−
0
View file @
681bc10e
...
@@ -955,3 +955,16 @@ class LazyObject(object):
...
@@ -955,3 +955,16 @@ class LazyObject(object):
__len__
=
_new_method_proxy
(
len
)
__len__
=
_new_method_proxy
(
len
)
__contains__
=
_new_method_proxy
(
operator
.
contains
)
__contains__
=
_new_method_proxy
(
operator
.
contains
)
# We try to minimize non-trivial dependencies for non-critical features. The
# setproctitle package is implemented as a C extension and hence requires a C
# compiler and the Python development headers. Here we use it as an optional
# dependency.
try
:
import
setproctitle
as
_setproctitle
def
set_process_name
(
name
):
_setproctitle
.
setproctitle
(
name
)
except
ImportError
:
def
set_process_name
(
name
):
pass
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