Unverified Commit f7e6d16d authored by David López's avatar David López Committed by GitHub
Browse files

Merge pull request #17388 from davelopez/update_webdav_conf_sample

[23.1] Set webdav file source to use temp files by default
parents 11fdad09 7d276348
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -12,6 +12,12 @@
  root: ${user.preferences['owncloud|root']}
  login: ${user.preferences['owncloud|username']}
  password: ${user.preferences['owncloud|password']}
  # By default, the plugin will use temp files to avoid loading entire files into memory. 
  # You can change the directory here or omit to use the default temp directory.
  temp_path: /your/temp/path
  # Set writable to true if you have write access to this source
  # and want to allow exporting files to it, by default is read only.
  writable: false

- type: posix
  root: '/data/5/galaxy_import/galaxy_user_data/covid-19/data/sequences/'
+6 −0
Original line number Diff line number Diff line
@@ -3,6 +3,7 @@ try:
except ImportError:
    WebDAVFS = None

import tempfile
from typing import (
    Optional,
    Union,
@@ -22,6 +23,11 @@ class WebDavFilesSource(PyFilesystem2FilesSource):

    def _open_fs(self, user_context=None, opts: Optional[FilesSourceOptions] = None):
        props = self._serialization_props(user_context)
        use_temp_files = props.pop("use_temp_files", None)
        if use_temp_files is None:
            # Default to True to avoid memory issues with large files.
            props["use_temp_files"] = True
            props["temp_path"] = props.get("temp_path", tempfile.TemporaryDirectory(prefix="webdav_"))
        extra_props: Union[FilesSourceProperties, dict] = opts.extra_props or {} if opts else {}
        handle = WebDAVFS(**{**props, **extra_props})
        return handle