sbisbee/sag — Issue #42: sag operations fail after post or bulk
Author: Steltek
Created: 2012-01-09 12:49:56+00:00
State: open

Note entirely sure if this is me coding something wrong or a bug in sag but I figured I'd report it anyway. I have the following code:

$now = time();
$ddoc = new stdClass();
$ddoc->type = "lock";
$ddoc->user = $user;
$ddoc->locktype = $locktype;
$ddoc->timestamp = $now;

try
{
$sag->post($ddoc);
}
catch(Exception $e)
{
error_log("Something's wrong");
}

Oddly enough, after that code has run, the next $sag-> operation (at least gets and posts) just fails. I have worked around this by simply adding a $sag->get after each post that I do, but I am wondering whether I'm just misusing post (Am I supposed to call anything after posting? The examples don't really show the use of post.) or whether sag is somehow not closing the operation properly.