Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: allow multiple libreoffice invocations
LibreOffice only allows one invocation per user profile.[^1] The office provider set the user profile to /tmp/owncloud-instanceid and therefore only one invocation per instance is allowed. This was introduced a while ago, yet it's unclear if this was intentionally or just a side effect.[^2] The limitation on one invocation leads to the situation that the preview generation only works for a couple of files if you upload a whole folder of emf or word files. This commit removes the limitation by using a new user profile for each preview. That's done by using instance id plus file id as postfix for getTemporaryFolder. This has some drawbacks: - Overload protection: If you upload 100 emf files, you may end up with 100 LibreOffice invocations. Though, you can use preview_concurrency_new to limit the number of previews that can be generated concurrently when php-sysvsem is available. - New profile: I assume it takes a few bits to generate a fresh LibreOffice user profile. It appears that there is no way to ask LibreOffice to not create a profile and just work with the defaults. The profile will be cleaned after use by our temp manager. - Remove the configuration option preview_office_cl_parameters: This is not strictly necessary yet, but if you set the configuration option, the generated path for the user profile is also missing. The configuration option is not well documented (e.g., it's unclear that the last option needs to be --outdir) and actually, there should be no reason to change it after all. [^1]: https://wiki.documentfoundation.org/UserProfile [^2]: owncloud/core#9784 Signed-off-by: Daniel Kesselberg <[email protected]>
- Loading branch information