wwwision / asset-sync
Neos Flow 包,用于同步导入 Neos.Media 资产的元数据和二进制数据
1.1.0
2022-05-20 14:26 UTC
Requires
- php: >=7.4
- neos/media: ^7.0
- wwwision/batch-processing: ^1.0
Requires (Dev)
- phpunit/phpunit: ^9.0
- roave/security-advisories: dev-latest
README
用于同步导入 Neos.Media 资产的元数据和资源的 Flow 包
安装
通过以下方式安装此包:
composer require wwwision/asset-sync
用法
运行
./flow media:synchronizeimportedassets
来更新所有导入资产的元数据。
使用以下选项来微调行为
--asset-sources Comma separated list of Asset Source identifiers to sync. If null, all imported assets are synced.
--synchronize-resources If set, resource binaries are synchronized (this can be slow!). Otherwise, only the asset metadata is updated.
--batch-size Number of assets to synchronize in a single run. Larger numbers can increase performance but may lead to high memory consumption
--pool-size Maximum number of sub processes to run at the same time
--quiet If set only the number of errors is outputted (if any)
定时任务
为了保持导入的资产同步,应定期运行 synchronizeImportedAssets
命令,例如通过 cronjob。
以下设置将每小时同步指定资产源的资源元数据,每天同步一次相应的资源。
0 * * * * ./flow wwwision.assetsync:media:synchronizeimportedassets --asset-sources assetsource1,assetsource2 --quiet
30 0 * * * ./flow wwwision.assetsync:media:synchronizeimportedassets --asset-sources assetsource1,assetsource2 --synchronize-resources --quiet
批量和池大小
默认情况下,每次将处理 500 个资产,最多将执行 5 批次。这可以通过 --batch-size
和 --pool-size
选项进行更改。有关详细信息,请参阅 Wwwision.BatchProcessing。
致谢
本实现的部分灵感来自 Karsten Dambekalns 的工作。本包的开发得到了 Marktplatz GmbH - Agentur für Web & App 的慷慨赞助。感谢您对开源发展的支持!
贡献
非常欢迎以问题或拉取请求形式进行的贡献
许可证
请参阅 LICENSE