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
5ca4d216
Commit
5ca4d216
authored
10 years ago
by
Vermaat
Browse files
Options
Downloads
Patches
Plain Diff
Fix sync of local cache with remote cache
parent
55ca04e1
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
mutalyzer/entrypoints/admin.py
+5
-1
5 additions, 1 deletion
mutalyzer/entrypoints/admin.py
mutalyzer/sync.py
+9
-2
9 additions, 2 deletions
mutalyzer/sync.py
with
14 additions
and
3 deletions
mutalyzer/entrypoints/admin.py
+
5
−
1
View file @
5ca4d216
...
...
@@ -136,7 +136,11 @@ def sync_cache(wsdl_url, url_template, history=7):
55 5 * * * mutalyzer-cache-sync
'
http://dom2/?wsdl
'
'
http://dom2/{file}
'
-H 7
"""
cache_sync
=
sync
.
CacheSync
(
output
.
Output
(
__file__
))
cache_sync
.
sync_with_remote
(
wsdl_url
,
url_template
,
history
)
inserted
,
downloaded
=
cache_sync
.
sync_with_remote
(
wsdl_url
,
url_template
,
history
)
print
(
'
Added %d entries to the local cache and downloaded %d cache files.
'
%
(
inserted
,
downloaded
))
def
set_announcement
(
body
,
url
=
None
):
...
...
This diff is collapsed.
Click to expand it.
mutalyzer/sync.py
+
9
−
2
View file @
5ca4d216
...
...
@@ -107,16 +107,21 @@ class CacheSync(object):
"""
Create a nice dictionary out of the CacheEntry object.
"""
cast_orientation
=
{
None
:
None
,
1
:
'
forward
'
,
2
:
'
reverse
'
}
entry_dict
=
{
'
name
'
:
str
(
entry
.
name
),
'
hash
'
:
str
(
entry
.
hash
),
'
created
'
:
entry
.
created
}
for
attribute
in
(
'
gi
'
,
'
chromosomeName
'
,
'
url
'
,
'
cached
'
):
entry_dict
[
attribute
]
=
str
(
entry
[
attribute
])
\
if
attribute
in
entry
else
None
for
attribute
in
(
'
chromosomeStart
'
,
'
chromosomeStop
'
,
'
chromosomeOrientation
'
):
for
attribute
in
(
'
chromosomeStart
'
,
'
chromosomeStop
'
):
entry_dict
[
attribute
]
=
int
(
entry
[
attribute
])
\
if
attribute
in
entry
else
None
entry_dict
[
'
chromosomeOrientation
'
]
=
cast_orientation
[
entry
[
'
chromosomeOrientation
'
]]
\
if
'
chromosomeOrientation
'
in
entry
else
None
return
entry_dict
return
map
(
cache_entry_from_soap
,
cache
.
CacheEntry
)
...
...
@@ -195,6 +200,8 @@ class CacheSync(object):
slice_stop
=
entry
[
'
chromosomeStop
'
],
slice_orientation
=
entry
[
'
chromosomeOrientation
'
],
download_url
=
entry
[
'
url
'
])
session
.
add
(
reference
)
session
.
commit
()
inserted
+=
1
if
not
entry
[
'
chromosomeName
'
]
and
not
entry
[
'
url
'
]
\
and
entry
[
'
cached
'
]:
...
...
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