1- namespace InEngine . Core . Queuing . Commands
1+ using System ;
2+
3+ namespace InEngine . Core . Queuing . Commands
24{
35 public class Length : AbstractCommand
46 {
@@ -10,14 +12,45 @@ public override void Run()
1012
1113 public void PrintQueueLengths ( QueueAdapter queue )
1214 {
13- var leftPadding = 15 ;
15+ var textLeftPadding = 15 ;
16+ var numberLeftPadding = 2 ;
1417 Warning ( $ "{ queue . QueueName } Queue:") ;
15- InfoText ( "Pending" . PadLeft ( leftPadding ) ) ;
16- Line ( queue . GetPendingQueueLength ( ) . ToString ( ) . PadLeft ( 10 ) ) ;
17- InfoText ( "In-progress" . PadLeft ( leftPadding ) ) ;
18- Line ( queue . GetInProgressQueueLength ( ) . ToString ( ) . PadLeft ( 10 ) ) ;
19- ErrorText ( "Failed" . PadLeft ( leftPadding ) ) ;
20- Line ( queue . GetFailedQueueLength ( ) . ToString ( ) . PadLeft ( 10 ) ) ;
18+
19+ try
20+ {
21+ InfoText ( "" . PadLeft ( numberLeftPadding ) ) ;
22+ InfoText ( "Pending" ) ;
23+ InfoText ( "" . PadLeft ( textLeftPadding ) ) ;
24+ Line ( queue . GetPendingQueueLength ( ) . ToString ( ) ) ;
25+ }
26+ catch ( NotImplementedException )
27+ {
28+ Error ( "Not supported by queue client." ) ;
29+ }
30+
31+ try
32+ {
33+ InfoText ( "" . PadLeft ( numberLeftPadding ) ) ;
34+ InfoText ( "In-progress" ) ;
35+ InfoText ( "" . PadLeft ( textLeftPadding ) ) ;
36+ Line ( queue . GetInProgressQueueLength ( ) . ToString ( ) ) ;
37+ }
38+ catch ( NotImplementedException )
39+ {
40+ Error ( "Not supported by queue client." ) ;
41+ }
42+
43+ try
44+ {
45+ InfoText ( "" . PadLeft ( numberLeftPadding ) ) ;
46+ InfoText ( "Failed" ) ;
47+ InfoText ( "" . PadLeft ( textLeftPadding ) ) ;
48+ Line ( queue . GetFailedQueueLength ( ) . ToString ( ) ) ;
49+ }
50+ catch ( NotImplementedException )
51+ {
52+ Error ( "Not supported by queue client." ) ;
53+ }
2154 Newline ( ) ;
2255 }
2356 }
0 commit comments