fix zero-value for maxhistorylines actually meaning zero history lines

This commit is contained in:
mappu 2017-03-27 20:35:54 +13:00
parent f7c70603f2
commit eab781794e

View File

@ -87,7 +87,7 @@ func (this *App) LaunchTask(workDir string, params []string) (taskRef string, er
task := this.tasks[ref] task := this.tasks[ref]
task.output = append(task.output, OutputLine{isError: isError, text: text}) task.output = append(task.output, OutputLine{isError: isError, text: text})
if len(task.output) > 2*this.cfg.MaxHistoryLines { if this.cfg.MaxHistoryLines > 0 && len(task.output) > 2*this.cfg.MaxHistoryLines {
task.output = task.output[this.cfg.MaxHistoryLines:] task.output = task.output[this.cfg.MaxHistoryLines:]
} }
this.tasks[ref] = task this.tasks[ref] = task