File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
site/src/pages/WorkspacePage Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -166,13 +166,15 @@ export const WorkspaceReadyPage: FC<WorkspaceReadyPageProps> = ({
166
166
// Sometimes, the timings can be fetched before the agent script timings are
167
167
// done or saved in the database so we need to conditionally refetch the
168
168
// timings. To refetch the timings, I found the best way was to compare the
169
- // expected amount of script timings with the current amount of script
170
- // timings returned in the response.
169
+ // expected amount of script timings that run on start, with the current
170
+ // amount of script timings returned in the response.
171
171
refetchInterval : ( data ) => {
172
172
const expectedScriptTimingsCount = workspace . latest_build . resources
173
173
. flatMap ( ( r ) => r . agents )
174
- . flatMap ( ( a ) => a ?. scripts ?? [ ] ) . length ;
174
+ . flatMap ( ( a ) => a ?. scripts ?? [ ] )
175
+ . filter ( ( script ) => script . run_on_start ) . length ;
175
176
const currentScriptTimingsCount = data ?. agent_script_timings ?. length ?? 0 ;
177
+
176
178
return expectedScriptTimingsCount === currentScriptTimingsCount
177
179
? false
178
180
: 1_000 ;
You can’t perform that action at this time.
0 commit comments