I currently have a method in my model to scrape a site and insert records to a database.
def self.scrape
#scrape
#insert into database
end
I set up a controller method to call it:
def scrape
Website.send_later(:scrape)
end
The scraping is working and have tested it by running it through the console. However, running it by activating it through calling the controller method it didn't work.
I've tried rake jobs:work
it says the following:
[Worker(host:thorpe-desktop pid:6962)] Starting job worker
[Worker(host:thorpe-desktop pid:6962)] Class#scrape completed after 0.5068
[Worker(host:thorpe-desktop pid:6962)] 1 jobs processed at 0.5898 j/s, 0 failed ...
I don't see anything in the database table where it should have inserted data.