Skip to content
Snippets Groups Projects
Commit a563d9b9 authored by Janne Mareike Koschinski's avatar Janne Mareike Koschinski
Browse files

Minor fixes

parent a9ad25f5
Branches
No related tags found
No related merge requests found
......@@ -10,6 +10,7 @@ import (
"fmt"
"encoding/base64"
"crypto/rand"
"time"
)
func writeBody(reader io.ReadCloser, path string) error {
......@@ -116,6 +117,8 @@ func main() {
return
}
fmt.Printf("Created task %s at %d\n", image.Id, time.Now().Unix())
data, err := json.Marshal(image)
if err != nil {
returnResult(w, Result{
......@@ -129,6 +132,8 @@ func main() {
pubsub := client.Subscribe(config.ResultChannel)
client.RPush(fmt.Sprintf("queue:%s", config.ImageQueue), data)
fmt.Printf("Submitted task %s at %d\n", image.Id, time.Now().Unix())
waiting := true
for waiting {
message, err := pubsub.ReceiveMessage()
......@@ -152,6 +157,8 @@ func main() {
return
}
fmt.Printf("Returned task %s at %d\n", result.Id, time.Now().Unix())
if result.Id == image.Id {
waiting = false
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment