Don't try to cleanup data in client when FIFO doesn't appear.

I think it was in error to go for a lock on the data and clear it —
even if it's data the client had set — when we timeout waiting for
the named pipe to appear.  If the named pipe never appeared, then
something is likely really wrong with the server anyway, and as such,
we might as well expect the server to do the cleanup.
This commit is contained in:
Bradley M. Kuhn 2020-06-16 13:37:42 -07:00
parent 90e6da323e
commit 02a2fcbbc9
No known key found for this signature in database
GPG key ID: F15E8BD6D05E26B3

View file

@ -32,12 +32,7 @@ sub BeancountQuerySubmit($;$) {
my $cnt = 0;
while (not defined $BEANCOUNT_QUERY{fifoName}) {
sleep 1;
if ($cnt++ >= (5 * 60)) {
(tied %BEANCOUNT_QUERY)->shlock;
$BEANCOUNT_QUERY{question} = $BEANCOUNT_QUERY{format} = undef;
(tied %BEANCOUNT_QUERY)->shunlock;
die "Unable to initiate query to beancount server\n";
}
die "Unable to initiate query to beancount server\n" if ($cnt++ >= (5 * 60));
}
unless (-p $BEANCOUNT_QUERY{fifoName}) {
(tied %BEANCOUNT_QUERY)->shlock;