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
87b3d8e2
Commit
87b3d8e2
authored
Nov 20, 2015
by
David Read
Browse files
Merge pull request #6 from datagovuk/fix-slow-imports
Fix slow import, delay loading celery
parents
cc36ee3c
4d0d5312
Changes
1
Hide whitespace changes
Inline
Side-by-side
ckanext/archiver/plugin.py
View file @
87b3d8e2
...
...
@@ -4,7 +4,6 @@ import os
from
ckan
import
model
from
ckan.model.types
import
make_uuid
from
ckan
import
plugins
as
p
from
ckan.lib.celery_app
import
celery
from
ckanext.report.interfaces
import
IReport
from
ckanext.archiver.interfaces
import
IPipe
import
ckan.plugins.toolkit
as
toolkit
...
...
@@ -47,6 +46,7 @@ class ArchiverPlugin(p.SingletonPlugin):
def
create_archiver_resource_task
(
resource
,
queue
):
from
pylons
import
config
from
ckan.lib.celery_app
import
celery
package
=
resource
.
resource_group
.
package
task_id
=
'%s/%s/%s'
%
(
package
.
name
,
resource
.
id
[:
4
],
make_uuid
()[:
4
])
ckan_ini_filepath
=
os
.
path
.
abspath
(
config
[
'__file__'
])
...
...
@@ -55,6 +55,7 @@ def create_archiver_resource_task(resource, queue):
log
.
debug
(
'Archival of resource put into celery queue %s: %s/%s url=%r'
,
queue
,
package
.
name
,
resource
.
id
,
resource
.
url
)
def
create_archiver_package_task
(
package
,
queue
):
from
ckan.lib.celery_app
import
celery
from
pylons
import
config
task_id
=
'%s/%s'
%
(
package
.
name
,
make_uuid
()[:
4
])
ckan_ini_filepath
=
os
.
path
.
abspath
(
config
[
'__file__'
])
...
...
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