#define PLUGIN_VERSION 1
#endif
+#define BUSY_WAITING_USEC 50000 /* 0.05 sec */
+#define BUSY_WAITING_MAX 20 /* wait for max 1 sec */
+
+
static gboolean __update_query_database(Storage *strg, void *handle, const char *query, GHashTable *in_param)
{
int rv = 0;
static int _busy_handler(void *pData, int count)
{
- if (5 - count > 0) {
- dbg("Busy Handler Called! : CNT(%d)\n", count + 1);
- usleep((count + 1) * 100000);
+ if (count < BUSY_WAITING_MAX) {
+ usleep(BUSY_WAITING_USEC);
return 1;
- } else {
- dbg("Busy Handler will be returned SQLITE_BUSY error\n");
- return 0;
}
+
+ dbg("Busy Handler will be returned SQLITE_BUSY error\n");
+ return 0;
}
static void *create_handle(Storage *strg, const char *path)