Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
MJU-POPS
ckanext-archiver
Commits
95285e88
Commit
95285e88
authored
Apr 21, 2020
by
Marko Kuder
Browse files
debugging stringified archival field in resources
parent
0fbf65f9
Changes
1
Hide whitespace changes
Inline
Side-by-side
ckanext/archiver/tasks.py
View file @
95285e88
...
...
@@ -106,7 +106,8 @@ def update_resource(ckan_ini_filepath, resource_id, queue='bulk', force=False):
# celery's task status.
try
:
result
=
_update_resource
(
resource_id
,
queue
,
log
,
force
)
return
result
# serialized for Celery
return
json
.
dumps
(
result
)
except
Exception
,
e
:
if
os
.
environ
.
get
(
'DEBUG'
):
raise
...
...
@@ -288,8 +289,9 @@ def _update_resource(resource_id, queue, log, force):
_save
(
Status
.
by_text
(
'Archived successfully'
),
''
,
resource
,
download_result_mock
[
'url_redirected_to'
],
download_result_mock
,
archive_result_mock
)
# The return value is only used by tests. Serialized for Celery.
return
json
.
dumps
(
dict
(
download_result_mock
,
**
archive_result_mock
))
#this used to be serialized to JSON string (supposedly for Celery). Moved the serialization to resource_update
#to avoid bugs because of stringified archival fields in resources
return
dict
(
download_result_mock
,
**
archive_result_mock
)
# endif: processing locally uploaded resource
...
...
@@ -365,8 +367,9 @@ def _update_resource(resource_id, queue, log, force):
_save
(
Status
.
by_text
(
'Archived successfully'
),
''
,
resource
,
download_result
[
'url_redirected_to'
],
download_result
,
archive_result
)
# The return value is only used by tests. Serialized for Celery.
return
json
.
dumps
(
dict
(
download_result
,
**
archive_result
))
#this used to be serialized to JSON string (supposedly for Celery). Moved the serialization to resource_update
#to avoid bugs because of stringified archival fields in resources
return
dict
(
download_result
,
**
archive_result
)
def
download
(
context
,
resource
,
url_timeout
=
30
,
...
...
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