From 7358ca67e8b39a58b631d64ff9efe7f31479ae6c Mon Sep 17 00:00:00 2001 From: shoopea Date: Sun, 12 Jan 2020 17:17:14 +0800 Subject: [PATCH] update jobs --- job.go | 3 ++- obj.go | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/job.go b/job.go index 2e3768e..dde57ce 100644 --- a/job.go +++ b/job.go @@ -3,6 +3,7 @@ package main import ( "archive/zip" "bytes" + "compress/zlib" "encoding/json" "errors" "fmt" @@ -18,7 +19,7 @@ import ( ) func createJob(jobTypeID64 int64, priority int32, userID64 int64, trigger int64, schedule time.Time, payload []byte) (int64, error) { - zb := make(bytes.Buffer) + zb := new(bytes.Buffer) zw := zlib.NewWriter(&zb) zw.Write(payload) zw.Close() diff --git a/obj.go b/obj.go index 311d52c..310df10 100644 --- a/obj.go +++ b/obj.go @@ -1,6 +1,8 @@ package main import ( + "bytes" + "compress/zlib" "encoding/json" "errors" "fmt"