3
3
4
4
define ( [
5
5
'deepforge/updates/Updates' ,
6
+ 'deepforge/utils' ,
6
7
'js/Constants' ,
7
8
'js/PanelBase/PanelBase' ,
8
9
'panels/AutoViz/AutoVizPanel' ,
@@ -11,6 +12,7 @@ define([
11
12
'q'
12
13
] , function (
13
14
Updates ,
15
+ Utils ,
14
16
CONSTANTS ,
15
17
PanelBase ,
16
18
AutoVizPanel ,
@@ -164,15 +166,14 @@ define([
164
166
} ) ;
165
167
} ;
166
168
167
- SidebarPanel . prototype . applyUpdates = function ( updates ) {
168
- // Seed Updates should apply the
169
+ SidebarPanel . prototype . applyUpdates = async function ( updates ) {
169
170
const seedUpdates = updates . filter ( update => update . type === Updates . SEED ) ;
170
- const promises = seedUpdates . map ( update => {
171
- const { name, hash} = update ;
172
- return Q . ninvoke ( this . _client , 'updateLibrary' , name , hash ) ;
173
- } ) ;
171
+ for ( let i = 0 ; i < seedUpdates . length ; i ++ ) {
172
+ const { name, hash} = seedUpdates [ i ] ;
173
+ await Q . ninvoke ( this . _client , 'updateLibrary' , name , hash ) ;
174
+ }
174
175
175
- // Apply the migrations
176
+ await Utils . sleep ( 1000 ) ;
176
177
const pluginId = 'ApplyUpdates' ;
177
178
const migrations = updates
178
179
. filter ( update => update . type === Updates . MIGRATION )
@@ -183,11 +184,7 @@ define([
183
184
updates : migrations
184
185
} ;
185
186
186
- promises . push (
187
- Q . ninvoke ( this . _client , 'runServerPlugin' , pluginId , context )
188
- ) ;
189
-
190
- return Q . all ( promises ) ;
187
+ await Q . ninvoke ( this . _client , 'runServerPlugin' , pluginId , context ) ;
191
188
} ;
192
189
193
190
return SidebarPanel ;
0 commit comments