diff --git a/wavesrv/pkg/sstore/dbops.go b/wavesrv/pkg/sstore/dbops.go index a4967cf0..75b778ca 100644 --- a/wavesrv/pkg/sstore/dbops.go +++ b/wavesrv/pkg/sstore/dbops.go @@ -1391,17 +1391,9 @@ func ArchiveScreenLines(ctx context.Context, screenId string) (*ModelUpdate, err if !tx.Exists(query, screenId) { return fmt.Errorf("screen does not exist") } - fmt.Printf("** archive-screen-lines: %s\n", screenId) - if isWebShare(tx, screenId) { - query = `INSERT INTO screenupdate (screenid, lineid, updatetype, updatets) - SELECT screenid, lineid, ?, ? FROM line WHERE screenid = ? AND archived = 0` - tx.Exec(query, UpdateType_LineDel, time.Now().UnixMilli(), screenId) - NotifyUpdateWriter() - query = `SELECT count(*) FROM line WHERE screenid = ? AND archived = 0` - count := tx.GetInt(query, screenId) - fmt.Printf("** archive-screen-lines: wrote into screenupdate: %d\n", count) - } - query = `UPDATE line SET archived = 1 WHERE screenid = ? AND archived = 0` + query = `UPDATE line SET archived = 1 + WHERE line.archived = 0 AND line.screenid = ? AND NOT EXISTS (SELECT * FROM cmd c + WHERE line.screenid = c.screenid AND line.lineid = c.lineid AND c.status IN ('running', 'detached'))` tx.Exec(query, screenId) return nil }) @@ -1709,7 +1701,7 @@ const ( ScreenField_SelectedLine = "selectedline" // int ScreenField_Focus = "focustype" // string ScreenField_TabColor = "tabcolor" // string - ScreenField_TabIcon = "tabicon" // string + ScreenField_TabIcon = "tabicon" // string ScreenField_PTerm = "pterm" // string ScreenField_Name = "name" // string ScreenField_ShareName = "sharename" // string