首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用heroku调度器调度websolr重建索引

使用heroku调度器调度websolr重建索引
EN

Stack Overflow用户
提问于 2014-09-05 10:50:30
回答 2查看 85关注 0票数 0

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

代码语言:javascript
复制
heroku run python manage.py rebuild_index

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

代码语言:javascript
复制
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‘的信号,以便在Scheduler中使用我的命令定期构建索引?

EN

回答 2

Stack Overflow用户

发布于 2014-09-05 15:13:55

找到了答案,添加'yes‘命令就完成了http://en.wikipedia.org/wiki/Yes_(Unix)操作

代码语言:javascript
复制
heroku run 'yes | python manage.py rebuild_index' 
票数 0
EN

Stack Overflow用户

发布于 2015-09-29 02:03:48

您可以将--noinput参数传递给rebuild命令,如下所示:

python heroku运行python manage.py rebuild_index --noinput

有关更多选项,请参阅Haystack management command documentation

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/25677976

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档