From 9a026a27e4d9b6330772dcaf418c9b16b48976b1 Mon Sep 17 00:00:00 2001 From: Matt Hill Date: Tue, 3 Jun 2014 16:41:57 -0400 Subject: [PATCH] Writing to beanstalk queue --- src/daemon.cpp | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/src/daemon.cpp b/src/daemon.cpp index 675a49f..6d4f1b5 100644 --- a/src/daemon.cpp +++ b/src/daemon.cpp @@ -224,27 +224,15 @@ bool writeToQueue(std::string jsonResult) { Beanstalk::Client client("127.0.0.1", 11300); - client.use("test"); - client.watch("test"); + client.use("alpr"); + //client.watch("test"); int id = client.put(jsonResult); if (id <= 0) - return 1; + return false; std::cout << "put job id: " << id << std::endl; - Beanstalk::Job job; - client.reserve(job); - - if (job.id() != id) - return 1; - - std::cout << "reserved job id: " - << job.id() - << " with body: " << job.body() << "" - << std::endl; - - client.del(job.id()); - std::cout << "deleted job id: " << job.id() << std::endl; + return true; }