DCOR-dev / DCOR-Aid

GUI for managing data on DCOR
https://dcor.mpl.mpg.de
GNU General Public License v3.0
1 stars 2 forks source link

Use `package_revise` instead of `resource_create` #28

Closed paulmueller closed 3 years ago

paulmueller commented 3 years ago

Affected code:

https://github.com/DCOR-dev/DCOR-Aid/blob/71097d9b6ea4e217faa51b6e433dd9dab9d7e858/dcoraid/upload/dataset.py#L70-L80

Using package_revise instead of resource_create was @wardi's suggestion in the ckan gitter.im chat. package_revise can be used with the __extend syntax to support file uploads.

The original problem were race conditions when resources were added and at the same time package_revise was called from other threads. package_revise should be atomic if and only if only package_revise is used.

paulmueller commented 3 years ago

https://github.com/ckan/ckanapi/issues/181

paulmueller commented 3 years ago

In 4db9a95, a temporary workaround for failing tests or hanging "online" states is implemented. If package_revise works, then everything will be much more efficient.

paulmueller commented 3 years ago

Package revise works now. However, the server-side implementation is still pending. Currently, I am using a workaround for https://github.com/ckan/ckan/issues/2949 and manually call after_create and generate the resource views (see https://github.com/ckan/ckan/issues/6472).