From cf0df0e6d84a76649d8cbf8adcbf83efb6e883ab Mon Sep 17 00:00:00 2001
From: MohamedBassem <me@mbassem.com>
Date: Fri, 12 Apr 2024 00:15:37 +0300
Subject: fix: Differentiate between pending in db and in redis in admin job
 stats

---
 apps/web/app/dashboard/admin/page.tsx | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

(limited to 'apps/web/app/dashboard/admin/page.tsx')

diff --git a/apps/web/app/dashboard/admin/page.tsx b/apps/web/app/dashboard/admin/page.tsx
index c1fa4dee..65ac44e1 100644
--- a/apps/web/app/dashboard/admin/page.tsx
+++ b/apps/web/app/dashboard/admin/page.tsx
@@ -163,24 +163,28 @@ function ServerStatsSection() {
       <Table className="lg:w-1/2">
         <TableHeader>
           <TableHead>Job</TableHead>
+          <TableHead>Queued</TableHead>
           <TableHead>Pending</TableHead>
           <TableHead>Failed</TableHead>
         </TableHeader>
         <TableBody>
           <TableRow>
             <TableCell className="lg:w-2/3">Crawling Jobs</TableCell>
-            <TableCell>{serverStats.pendingCrawls}</TableCell>
-            <TableCell>{serverStats.failedCrawls}</TableCell>
+            <TableCell>{serverStats.crawlStats.queuedInRedis}</TableCell>
+            <TableCell>{serverStats.crawlStats.pending}</TableCell>
+            <TableCell>{serverStats.crawlStats.failed}</TableCell>
           </TableRow>
           <TableRow>
             <TableCell>Indexing Jobs</TableCell>
-            <TableCell>{serverStats.pendingIndexing}</TableCell>
-            <TableCell>{serverStats.failedIndexing}</TableCell>
+            <TableCell>{serverStats.indexingStats.queuedInRedis}</TableCell>
+            <TableCell>-</TableCell>
+            <TableCell>-</TableCell>
           </TableRow>
           <TableRow>
-            <TableCell>OpenAI Jobs</TableCell>
-            <TableCell>{serverStats.pendingOpenai}</TableCell>
-            <TableCell>{serverStats.failedOpenai}</TableCell>
+            <TableCell>Inference Jobs</TableCell>
+            <TableCell>{serverStats.inferenceStats.queuedInRedis}</TableCell>
+            <TableCell>{serverStats.inferenceStats.pending}</TableCell>
+            <TableCell>{serverStats.inferenceStats.failed}</TableCell>
           </TableRow>
         </TableBody>
       </Table>
-- 
cgit v1.2.3-70-g09d2

