#define PENDING_ITEM_INTERVAL 1000
+#define GET_CONNECTION_ERROR_THRESHOLD 10
+#define GET_CONNECTION_ERROR_MODULO 1000
typedef enum {
APP_SIGNAL_DEAD,
APP_SIGNAL_LAUNCH,
static GDBusConnection *__get_connection(void)
{
GError *error = NULL;
+ static unsigned int error_count = 0;
if (__conn)
return __conn;
__conn = g_bus_get_sync(G_BUS_TYPE_SYSTEM, NULL, &error);
if (!__conn) {
- _E("g_bus_get_sync() is failed. error(%s)",
+ error_count++;
+ if (error_count < GET_CONNECTION_ERROR_THRESHOLD ||
+ error_count % GET_CONNECTION_ERROR_MODULO == 0) {
+ _E("g_bus_get_sync() is failed. error(%s)",
error ? error->message : "Unknown");
+ }
+
g_clear_error(&error);
return NULL;
}