فهرست منبع

Merge pull request #374 from smiclea/fix-progress-sort

Fix execution task progress updates sort
Dorin Paslaru 6 سال پیش
والد
کامیت
c23f0867ca
2فایلهای تغییر یافته به همراه2 افزوده شده و 2 حذف شده
  1. 1 1
      src/sources/MigrationSource.js
  2. 1 1
      src/sources/ReplicaSource.js

+ 1 - 1
src/sources/MigrationSource.js

@@ -36,7 +36,7 @@ class MigrationSourceUtils {
             if (sortNull !== false) {
               return sortNull
             }
-            return moment(b.created_at).isBefore(moment(a.created_at))
+            return moment(a.created_at).toDate().getTime() - moment(b.created_at).toDate().getTime()
           })
         }
       })

+ 1 - 1
src/sources/ReplicaSource.js

@@ -77,7 +77,7 @@ class ReplicaSourceUtils {
     if (execution.tasks) {
       execution.tasks.forEach(task => {
         if (task.progress_updates) {
-          task.progress_updates.sort((a, b) => moment(b.created_at).isBefore(moment(a.created_at)))
+          task.progress_updates.sort((a, b) => moment(a.created_at).toDate().getTime() - moment(b.created_at).toDate().getTime())
         }
       })
     }