gpt4 book ai didi

linux - 使用heroku调度程序调度websolr重新索引

转载 作者:太空宇宙 更新时间:2023-11-04 03:52:57 26 4
gpt4 key购买 nike

我在 Heroku 的 Schedule 应用程序中有一个计划命令,旨在重建 websolr 索引。

heroku run python manage.py rebuild_index

问题是该命令需要用户输入,因此它永远不会自动成功运行。

WARNING: This will irreparably remove EVERYTHING from your search index in connection 'default'.
Your choices after this are to restore from backups or rebuild via the `rebuild_index` command.
Are you sure you wish to continue? [y/N]

是否有其他方法可以使用 Heroku Scheduler 应用程序重建索引,或者是否可以在命令中自动发出“y”信号,以便使用调度程序中的命令定期构建索引?

最佳答案

找到答案,添加“yes”命令就可以了 http://en.wikipedia.org/wiki/Yes_(Unix)

heroku run 'yes | python manage.py rebuild_index' 

关于linux - 使用heroku调度程序调度websolr重新索引,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25677976/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com