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