AnsweredAssumed Answered

raise a flag in sugarcrm cache (set it to true) while in middle of process

Question asked by Asaf Army on Jun 10, 2015
Latest reply on Jun 11, 2015 by Rolustech Rolustech
This is my Sugarcrm.log

i added log comments in meeting logic hook ($GLOBALS['log']->fatal).
When saving a meeting, i can see in sugarcrm.log that each meeting save, has a process number.

on the other hand i have a scheduler i made and when it is operating, it creates another process number and i can see that too in the sugarcrm.log.

For example, in my sugarcrm.log:
26135 - is the process number of the scheduler that is running.
8546   - is the process number of the logic hook process:

Wed Jun 10 09:17:06 2015 [26135][1][FATAL] Preparing GC Service...Wed Jun 10 09:17:06 2015 [26135][1][FATAL] Setting Access Token value = {"access_token"
Wed Jun 10 09:17:06 2015 [26135][1][FATAL] Setting access token of = asaf
Wed Jun 10 09:17:06 2015 [26135][1][FATAL] GC Service Ready...
Wed Jun 10 09:17:06 2015 [26135][1][FATAL] 
Wed Jun 10 09:17:06 2015 [26135][1][FATAL] Executing an incremental sync...
Wed Jun 10 09:17:07 2015 [8546][2449f652-8d7f-a86d-758a-5577c2ec6549][FATAL] 
Wed Jun 10 09:17:07 2015 [8546][2449f652-8d7f-a86d-758a-5577c2ec6549][FATAL] Meeting after relationship add logic hook -------------------------  Meeting = meet9
Wed Jun 10 09:17:07 2015 [8546][2449f652-8d7f-a86d-758a-5577c2ec6549][FATAL] The assigned user GC is enabled in its profile, continuing...
Wed Jun 10 09:17:07 2015 [8546][2449f652-8d7f-a86d-758a-5577c2ec6549][FATAL] The user Calendar id is = some@gmail.com
Wed Jun 10 09:17:07 2015 [8546][2449f652-8d7f-a86d-758a-5577c2ec6549][FATAL] 


My problem is that sometimes they update the same meeting! and cause a big mess.
To prevent that i want to raise a flag in the php/sugarcrm cache (or other solution if you have one) , so the other process will check the flag and just get out, if a meeting is already updating at the same time.

1. tried to update a flag in config_override.php but it is only updated at the end of the process, when its not relevant anymore,not in the second i update it.
2. tried creating a checkbox field in meetings module and check it, but the check is also updated at the end of the before_save logic hook when its also not relevant anymore.

can someone help me find a way to set a flag somewhere, that will be updated in the split second i set it and that other processes can see it?

using Sugarcrm CE 6.5.13

Outcomes