22 Jul 2024 03:39 PM
Hello,
Who can confirm below?
When using a "event" or "problem" trigger in a workflow, why does it take 5 minutes for you can retrieve by DQL:
Events belonging to a Problem
Problem belonging to an Event
For my workflow needed to wait 3x 1:59 minutes to make it work (timeout per task is 2:00 min)k
KR Henk
25 Jul 2024 09:55 AM
Hi,
there is a slight delay between when Workflows are triggered (by an event), and when data is available in Grail to be fetched.
Though I've never seen a delay above 30 seconds. Could you share the DQL Statements that you're using to fetch those events / problems? Are you using the DQL Action, or writing JavaScript Code?
			
    
	
		
		
		25 Jul 2024
	
		
		10:15 AM
	
	
	
	
	
	
	
	
	
	
	
	
	
	
 - last edited on 
    
	
		
		
		02 Sep 2024
	
		
		01:24 PM
	
	
	
	
	
	
	
	
	
	
	
	
	
	
 by 
				
		 Michal_Gebacki
		
			Michal_Gebacki
		
		
		
		
		
		
		
		
	
			
		
Hello Christian,
This is the trigger:
Sending you the top/important part of the JS task:
			
    
	
		
		
		25 Jul 2024
	
		
		11:41 AM
	
	
	
	
	
	
	
	
	
	
	
	
	
	
 - last edited on 
    
	
		
		
		02 Sep 2024
	
		
		01:21 PM
	
	
	
	
	
	
	
	
	
	
	
	
	
	
 by 
				
		 Michal_Gebacki
		
			Michal_Gebacki
		
		
		
		
		
		
		
		
	
			
		
A wait time of 10 seconds (let's make it 15 seconds to be on the safe side) should be enough. In your code example, I believe you're missing the await statement.
export default async function ({ execution_id }) {
  console.log('Starting to sleep');
  const milliseconds = 15000; // sleep time
  await new Promise(resolve => setTimeout(resolve, milliseconds));
  console.log('Done sleeping');
}
Can you verify that the execution of the step that should sleep takes the expected amount of time, e.g., 15 seconds as in my example?
25 Jul 2024 02:45 PM
Hello Christian,
This will make your day, I have now a 20s wait,
No problems!
Thanks for you help and guidance!
KR Henk
