ruby - rails 的 task 中可以用 session,cookie 吗?
怪我咯
怪我咯 2017-04-21 11:19:01
0
1
557

在rails的目录中

lib/task/

foo.rake 文件中,可以使用 rails 的 session,cookie 吗?它是可以独立运行的任务,不知可不可以调用http相关的函数。

怪我咯
怪我咯

走同样的路,发现不同的人生

reply all(1)
迷茫

No, the rake command is executed independently of the Rub App Server (such as Unicorn).

One solution is to use resque or sidekiq background queue program to pass in the required session information as parameters when generating queue tasks.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!