在rails的目录中
lib/task/
的 foo.rake 文件中,可以使用 rails 的 session,cookie 吗?它是可以独立运行的任务,不知可不可以调用http相关的函数。
foo.rake
session,cookie
走同样的路,发现不同的人生
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.
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.