File tree Expand file tree Collapse file tree 3 files changed +13
-3
lines changed
src/InEngine.Core/Queuing Expand file tree Collapse file tree 3 files changed +13
-3
lines changed Original file line number Diff line number Diff line change 33using System . IO ;
44using System . Linq ;
55using InEngine . Core . Exceptions ;
6+ using Quartz ;
67
78namespace InEngine . Core . Queuing . Clients
89{
@@ -81,7 +82,7 @@ public bool Consume()
8182 var message = File . ReadAllText ( inProgressFilePath ) . DeserializeFromJson < Message > ( ) ;
8283 try
8384 {
84- Queue . ExtractCommandInstanceFromMessage ( message as IMessage ) . Run ( ) ;
85+ Queue . ExtractCommandInstanceFromMessageAndRun ( message as IMessage ) ;
8586 }
8687 catch ( Exception exception )
8788 {
Original file line number Diff line number Diff line change @@ -50,11 +50,10 @@ public bool Consume()
5050 var message = serializedMessage . DeserializeFromJson < Message > ( ) ;
5151 if ( message == null )
5252 return false ;
53- var commandInstance = Queue . ExtractCommandInstanceFromMessage ( message ) ;
5453
5554 try
5655 {
57- commandInstance . Run ( ) ;
56+ Queue . ExtractCommandInstanceFromMessageAndRun ( message as IMessage ) ;
5857 }
5958 catch ( Exception exception )
6059 {
Original file line number Diff line number Diff line change 55using InEngine . Core . Exceptions ;
66using InEngine . Core . Queuing . Clients ;
77using Newtonsoft . Json ;
8+ using Quartz ;
89using Serialize . Linq . Extensions ;
910
1011namespace InEngine . Core . Queuing
@@ -80,6 +81,15 @@ public static ICommand ExtractCommandInstanceFromMessage(IMessage message)
8081 ) as ICommand ;
8182 }
8283
84+ public static void ExtractCommandInstanceFromMessageAndRun ( IMessage message )
85+ {
86+ var command = ExtractCommandInstanceFromMessage ( message ) ;
87+ if ( command is IJob )
88+ ( command as IJob ) . Execute ( null ) ;
89+ else
90+ command . Run ( ) ;
91+ }
92+
8393 public long GetPendingQueueLength ( )
8494 {
8595 return QueueClient . GetPendingQueueLength ( ) ;
You can’t perform that action at this time.
0 commit comments