Running a process in background - advice please

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
rocketman
Posts: 1252
Joined: Fri Jan 02, 2009 11:22 pm
Location: Preston UK
Contact:

Running a process in background - advice please

Post by rocketman »

After 10 years of AIM use, this is still one I can't get my head around and can't make reliably work. Can anyone help

I have a process that takes 40 minutes to finish BUT, because of what it's doing - and because of the AIM rule processing structure, this one "Process" actually chains to another 4 processes in order to complete its functionality. This is an extreme example but I seem to hit a roadblock with lots of processes I would dearly love to put into background mode

In this example I put a ten second time in before it (the first process) is supposed to go into background mode. Number in parenthesis is the approx time each process takes)

Process 1 finds all the period ends I want to create members statements for sorted in date order ascending (2-3 secs)
Process 2 (Called from 1) finds any old statements for this period and deletes them (up to 20 secs)
Process 3 (Called from 2) does FIND Members WHERE (Members IN Period_Ends.Members_This_Period),and calls process 4. (4 - 5 seconds). after the return from 5 (IE after 4 is completed calculates the running totals for charges, credits, payments and opening and closing balances 5-10 secs depending on number of Transactions in the statement)
Process 4 Creates n new statement for a member (passed from 3 )lFinds all that members transactions Passes Each TX to process 5 one by one (3-5 secs for the FIND depending on number of transactions - could be 20-30 transactions per member)
Process 5 inserts the transaction (< 1 sec) After all transactions have been inserted control will return to process 3

I would have thought that it would have made a lot of sense for AIM to put the timer on the length of time it takes for the first process in the chain to FULLY COMPLETE including all the chained process calls. I know it's easy enough to log out and go back in again - but try telling a user that.
Rocketman

V8.7 Developer Edition. Server 2016 Standard edition. MySql 5.5
tford
Posts: 4238
Joined: Sat Mar 10, 2007 6:44 pm

Re: Running a process in background - advice please

Post by tford »

It would be nice to have a checkbox to simply force a process to run in background mode .. period. That would solve this issue for good.
Tom - V8.8 build 3137 - MySql / PostGres
customaware
Posts: 2399
Joined: Mon Jul 02, 2012 12:24 am
Location: Ulaanbaatar, Mongolia

Re: Running a process in background - advice please

Post by customaware »

+1
Cheers,
Mark
_________________
AwareIM 6.0, 8.7, 8.8, 9.0 , MariaDB, Windows 10, Ubuntu Linux. Theme: Default, Browser: Arc
Upcloud, Obsidian....
Image
ACDC
Posts: 1142
Joined: Sat Jun 30, 2007 5:03 pm
Location: California, USA

Re: Running a process in background - advice please

Post by ACDC »

The only way i get a process to run in background is to activate it from the scheduler. In your case, if its user-orientated maybe have the user start a process that sets a flag in system settings for the Scheduler to act upon. The scheduler would have to be set to check the flag periodically which could be an overhead, but how much will it be really (especially if there is a good time gap)

When the flag is activated by the user, advise the user that the process has been queued etc.


+ 1
Post Reply