Currently, I have a method in my model to clean the site and insert records into the database.
def self.scrape #scrape #insert into database end
I set the controller method to call it:
def scrape Website.send_later(:scrape) end
The scraper works and tested it by running it through the console. However, by launching it, activating it, calling the controller method, it did not work.
I 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 see nothing in the database table where it should have inserted data.
source share