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

标签 linux django heroku django-haystack websolr

我在 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/

相关文章:

javascript - 在 Django 中打开 Bootstrap 模态视图以编辑帖子

ruby-on-rails - 部署到 heroku 时 rake 中止找不到文件 twitter/bootstrap

css - Rails 4, Assets 编译

linux - git 克隆到主目录

linux - 当系统内存大于 8GB 时,为什么 linux 禁用磁盘写缓冲区?

django - nginx,uwsgi,DJango,DEBUG = False时的502, “upstream prematurely closed connection”

heroku - 在外部工作人员中使用 sqlalchemy 声明式

linux - nohup 在最后运行带有&符号的进程后台时没有效果?

linux - 使用自定义虚拟主机在 docker 中运行 nginx

django - Django包的间歇性ImportError