Forum OpenACS Q&A: schedule proc memory

Collapse
Posted by Malte Sussdorff on
I need to run a scheduled procedure in the middle of the night once. Sadly, if a restart happens between the time I called ad_schedule_proc and the middle of the night, the scheduled proc is gone.

Any central mechanism to prevent this? Or should I write a custom table that stores the procedure call and executes in the middle of the night and after successful running, deletes it from the db table again?

Collapse
2: Re: schedule proc memory (response to 1)
Posted by Claudio Pasolini on
... if a restart happens between the time I called ad_schedule_proc and the middle of the night, the scheduled proc is gone ...

Why? If you put your ad_schedule into a library sourced at aolserver start it will be scheduled again.

Collapse
Posted by Malte Sussdorff on
This is the whole point, ad_schedule_proc is called not by the library but when adding a user to the system.

Background: I need to add a user to 300 communities. Doing this during office hours will get us killed (because of the performance drain involved). Luckily I can delay this and schedule the creation to run in the middle of the night. But what happens if the system is restarted between the user adding and the execution time in the middle of the night?

Collapse
Posted by Steve Manning on
I would schedule the proc to always run and then get it to check for some other trigger to decide if it needs to actually do anything.

We use a similar idea for scheduled reports which we produce overnight from polled sales data.

- Steve

Collapse
5: Re: schedule proc memory (response to 1)
Posted by Dave Bauer on
Right, setup a queue of who needs to get added to what communities then clear it out once a day, or whenever is appropriate.

Although, I can't help but imagine the real solution is to NOT add those 300 communities to the user's portal. There HAS to be an easier way.

Collapse
Posted by Malte Sussdorff on
The setup is as follows:

Each customer has it's own community in .LRN so we have a customer portal (the community page).

Each employee needs to be able to work on all customers. Therefore the employee needs to be added to all customers to have the permission to see each task and the projects running with the customer.

If a new customer is added, all employees need to be added to the customer's community

If a new employee is added he needs to be added to all customers.

I would love to find a way for lazy adding (add the employee only when he actually has to work on the customer, but I am not sure how this could be achieved.

Collapse
Posted by Caroline Meeks on
Malte,

I think we discussed in AIM creating an employee group and granting that permissions (membership) in all the customer communities.

This might not work with all the user portlets, but for your application you probably don't want an employee to see aggregated items from all the customer communities anyway.

Did you try this? did it work?

Collapse
Posted by Malte Sussdorff on
Oh, didn't I mention that. Yes, it did work. Just give permission, make sure the f***ed inheritance of dotlrn-fs is configured correctly and so far no problem with the portlets we are using.