Skip to content

Commit

Permalink
fix 环境变量的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
wo10378931 committed Oct 16, 2019
1 parent 31f8e03 commit 4ab4892
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion backend/services/task.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ func AssignTask(task model.Task) error {
// 设置环境变量
func SetEnv(cmd *exec.Cmd, envs []model.Env, taskId string, dataCol string) *exec.Cmd {
// 默认环境变量
cmd.Env = append(cmd.Env, "CRAWLAB_TASK_ID="+taskId)
cmd.Env = append(os.Environ(), "CRAWLAB_TASK_ID="+taskId)
cmd.Env = append(cmd.Env, "CRAWLAB_COLLECTION="+dataCol)
cmd.Env = append(cmd.Env, "PYTHONUNBUFFERED=0")
cmd.Env = append(cmd.Env, "PYTHONIOENCODING=utf-8")
Expand Down

0 comments on commit 4ab4892

Please sign in to comment.