mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Fix windows build for r23452
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@23462 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
7581076364
commit
da08312047
@ -416,7 +416,11 @@ mysql_error_fn( dbi_conn conn, void* user_data )
|
||||
GncDbiSqlConnection *dbi_conn = (GncDbiSqlConnection*)be->sql_be.conn;
|
||||
const gchar* msg;
|
||||
gint err_num;
|
||||
#ifdef G_OS_WIN32
|
||||
const guint backoff_msecs = 1;
|
||||
#else
|
||||
const guint backoff_usecs = 1000;
|
||||
#endif
|
||||
|
||||
err_num = dbi_conn_error( conn, &msg );
|
||||
|
||||
@ -465,7 +469,11 @@ mysql_error_fn( dbi_conn conn, void* user_data )
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef G_OS_WIN32
|
||||
Sleep (backoff_msecs * 2 << dbi_conn->error_repeat);
|
||||
#else
|
||||
usleep (backoff_usecs * 2 << dbi_conn->error_repeat);
|
||||
#endif
|
||||
PINFO( "DBI error: %s - Reconnecting...\n", msg );
|
||||
if (dbi_conn)
|
||||
gnc_dbi_set_error( dbi_conn, ERR_BACKEND_CANT_CONNECT, 1, TRUE );
|
||||
@ -1034,7 +1042,11 @@ pgsql_error_fn( dbi_conn conn, void* user_data )
|
||||
GncDbiBackend *be = (GncDbiBackend*)user_data;
|
||||
GncDbiSqlConnection *dbi_conn = (GncDbiSqlConnection*)be->sql_be.conn;
|
||||
const gchar* msg;
|
||||
#ifdef G_OS_WIN32
|
||||
const guint backoff_msecs = 1;
|
||||
#else
|
||||
const guint backoff_usecs = 1000;
|
||||
#endif
|
||||
|
||||
(void)dbi_conn_error( conn, &msg );
|
||||
if ( g_str_has_prefix( msg, "FATAL: database" ) &&
|
||||
@ -1068,7 +1080,11 @@ pgsql_error_fn( dbi_conn conn, void* user_data )
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef G_OS_WIN32
|
||||
Sleep (backoff_msecs * 2 << dbi_conn->error_repeat);
|
||||
#else
|
||||
usleep (backoff_usecs * 2 << dbi_conn->error_repeat);
|
||||
#endif
|
||||
PINFO( "DBI error: %s - Reconnecting...\n", msg );
|
||||
gnc_dbi_set_error( dbi_conn, ERR_BACKEND_CANT_CONNECT, 1, TRUE );
|
||||
dbi_conn->conn_ok = TRUE;
|
||||
|
Loading…
Reference in New Issue
Block a user