bitbake: prserv: don't wait until exit to sync
authorBen Shelton <ben.shelton@ni.com>
Mon, 27 Oct 2014 17:27:23 +0000 (12:27 -0500)
committerPatrick Ohly <patrick.ohly@intel.com>
Fri, 9 Jan 2015 16:52:20 +0000 (08:52 -0800)
commitf4ea13eccbb387bdd4b073558b49e936de4f0660
treee0a8a9501e6b6796ce1ae1ee6726a71643f3d024
parent05ce76d1c3dbe679a0b7bde698363ba17c7918ac
bitbake: prserv: don't wait until exit to sync

In the commit 'prserv: Ensure data is committed', the PR server moved to
only committing transactions to the database when the PR server is
stopped.  This improves performance, but it means that if the machine
running the PR server loses power unexpectedly or if the PR server
process gets SIGKILL, the uncommitted package revision data is lost.

To fix this issue, sync the database periodically, once per 30 seconds
by default, if it has been marked as dirty.  To be safe, continue to
sync the database at exit regardless of its status.

(Bitbake rev: 973ac2cc63323ca9c3e916effa4765747db3564c)

Signed-off-by: Ben Shelton <ben.shelton@ni.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
bitbake/lib/prserv/db.py
bitbake/lib/prserv/serv.py