Background Services not working

Hi.
I tried adding a row in background_services table in database and it is showing on UI but not working. email is not coming.

INSERT INTO background_services (name, title, active, running, next_run, execute_interval, function, require_once, sort_order) VALUES
(‘expired_drugs_email_service’, ‘Expired Drugs Mail’, 1, 0, ‘2014-10-25 00:10:23’, 1, ‘drugs_expired’, ‘/library/MedEx/medex_background.php’, 50);

It is not working.

it looks like the row you added is trying to run the medex_background script, is that what you intend?

Yes I created a different function for my service in the same file Medex was already there and added a row for that function in the database but that is not working.

hi @manikchhabra ,
Recommend placing a simple error_log(“Debug”) debug statement at top of your drugs_expired function to see if it is running (it will post the Debug to your php error log). Then if confirm that is working, then means the background services engine is working ok.
-brady

The medex file that is there is MedEx_background.php,
not medex_background.php. Perhaps you just need to change the “case” of those two letters?

1 Like