@@ -41,7 +41,7 @@ import { createTypedAccumulator } from '../util/object'
4141import { pickPaths } from '../path/selection/quickPick'
4242import { Toast } from '../vscode/toast'
4343import { ConfigKey } from '../vscode/config'
44- import { checkSignalFile } from '../fileSystem'
44+ import { checkSignalFile , pollSignalFileForProcess } from '../fileSystem'
4545import { DVCLIVE_ONLY_RUNNING_SIGNAL_FILE } from '../cli/dvc/constants'
4646
4747export const ExperimentsScale = {
@@ -94,6 +94,9 @@ export class Experiments extends BaseRepository<TableData> {
9494 private readonly internalCommands : InternalCommands
9595 private readonly webviewMessages : WebviewMessages
9696
97+ private dvcLiveOnlyCleanupInitialized = false
98+ private dvcLiveOnlySignalFile : string
99+
97100 constructor (
98101 dvcRoot : string ,
99102 internalCommands : InternalCommands ,
@@ -105,6 +108,11 @@ export class Experiments extends BaseRepository<TableData> {
105108 ) {
106109 super ( dvcRoot , resourceLocator . beaker )
107110
111+ this . dvcLiveOnlySignalFile = join (
112+ this . dvcRoot ,
113+ DVCLIVE_ONLY_RUNNING_SIGNAL_FILE
114+ )
115+
108116 this . internalCommands = internalCommands
109117
110118 this . onDidChangeIsParamsFileFocused = this . paramsFileFocused . event
@@ -164,9 +172,8 @@ export class Experiments extends BaseRepository<TableData> {
164172 }
165173
166174 public async setState ( data : ExperimentsOutput ) {
167- const dvcLiveOnly = await checkSignalFile (
168- join ( this . dvcRoot , DVCLIVE_ONLY_RUNNING_SIGNAL_FILE )
169- )
175+ const dvcLiveOnly = await this . checkSignalFile ( )
176+
170177 const commitMessages : { [ sha : string ] : string } =
171178 await this . internalCommands . executeCommand (
172179 AvailableCommands . GIT_GET_LAST_THREE_COMMIT_MESSAGES ,
@@ -602,4 +609,19 @@ export class Experiments extends BaseRepository<TableData> {
602609 this . onDidChangeColumns
603610 )
604611 }
612+
613+ private async checkSignalFile ( ) {
614+ const dvcLiveOnly = await checkSignalFile ( this . dvcLiveOnlySignalFile )
615+
616+ if ( dvcLiveOnly && ! this . dvcLiveOnlyCleanupInitialized ) {
617+ this . dvcLiveOnlyCleanupInitialized = true
618+ pollSignalFileForProcess ( this . dvcLiveOnlySignalFile , ( ) => {
619+ this . dvcLiveOnlyCleanupInitialized = false
620+ if ( this . hasRunningExperiment ( ) ) {
621+ this . cliData . update ( )
622+ }
623+ } )
624+ }
625+ return dvcLiveOnly
626+ }
605627}
0 commit comments