Skip to content

Commit

Permalink
perf: update code
Browse files Browse the repository at this point in the history
  • Loading branch information
LeeEirc committed Aug 12, 2024
1 parent 9cdaab0 commit 8f0bd70
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions pkg/guacd/parameters.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,8 @@ const (
const (
READONLY = "read-only"
)

const (
BoolFalse = "false"
BoolTrue = "true"
)
8 changes: 4 additions & 4 deletions pkg/tunnel/replay_recorder.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ func (r *ReplayRecorder) Start(ctx context.Context) {
}
recordDirPath := filepath.Join(config.GlobalConfig.RecordPath,
r.tunnelSession.Created.Format(recordDirTimeFormat))
sessionReplayRootPath := filepath.Join(recordDirPath, r.tunnelSession.ID)
_ = os.MkdirAll(sessionReplayRootPath, os.ModePerm)
r.RootPath = sessionReplayRootPath
rootPath := filepath.Join(recordDirPath, r.SessionId)
_ = os.MkdirAll(rootPath, os.ModePerm)
r.RootPath = rootPath
go r.run(ctx)
}

Expand Down Expand Up @@ -145,6 +145,6 @@ func (r *ReplayRecorder) recordReplay(ctx context.Context, wg *sync.WaitGroup) {
func NewReplayConfiguration(conf *guacd.Configuration, connectionId string) guacd.Configuration {
newCfg := conf.Clone()
newCfg.ConnectionID = connectionId
newCfg.SetParameter(guacd.READONLY, "true")
newCfg.SetParameter(guacd.READONLY, guacd.BoolTrue)
return newCfg
}

0 comments on commit 8f0bd70

Please sign in to comment.