File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed
packages/jobs/src/Resources/JobsWaitingResource/Widgets Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -21,10 +21,19 @@ protected function getCards(): array
2121 ->select (DB ::raw ('COUNT(*) as count ' ))
2222 ->first ();
2323
24- $ aggregationColumns = [
25- DB ::raw ('SUM(finished_at - started_at) as total_time_elapsed ' ),
26- DB ::raw ('AVG(finished_at - started_at) as average_time_elapsed ' ),
27- ];
24+ $ driver = DB ::getDriverName ();
25+
26+ if (in_array ($ driver , ['pgsql ' , 'crdb ' ])) {
27+ $ aggregationColumns = [
28+ DB ::raw ('SUM(finished_at::int - started_at::int) as total_time_elapsed ' ),
29+ DB ::raw ('AVG(finished_at::int - started_at::int) as average_time_elapsed ' ),
30+ ];
31+ } else {
32+ $ aggregationColumns = [
33+ DB ::raw ('SUM(finished_at - started_at) as total_time_elapsed ' ),
34+ DB ::raw ('AVG(finished_at - started_at) as average_time_elapsed ' ),
35+ ];
36+ }
2837
2938 $ aggregatedInfo = JobManager::query ()
3039 ->select ($ aggregationColumns )
You can’t perform that action at this time.
0 commit comments