Hamdan
Hamdan

Reputation: 193

Persistent Object defined by a CronJob on Rails

I have a report that takes too long to be assembled, so I would like to make a CronJob (with rufus scheduler gem) to generate the report after midnight when there´s no traffic on my application.

The question is: do I need to save the result of the CronJob routine in a DB table or can I have it by mantaining it on a Global Variable for example. Is this possible? Is this usual and safe?

The objective is to have the report without using de DB. So I would generate an (lets say) array with all the daily data of the report, and with the UX I would manipulate my report as I want without messing with my DB that makes my server (AWS) get loaded and slowing down the entire website. That way, my controllers would use the Persistent Array to generate the reports and my server will keep running fast.

Upvotes: 0

Views: 58

Answers (0)

Related Questions