Properly use #ifdef HAVE_LIBCURL.

pull/1703/head
Hadi Moshayedi 2017-10-13 13:43:16 -04:00 committed by Jason Petersen
parent 01353cb7cb
commit 2aec6eda49
4 changed files with 9 additions and 5 deletions

View File

@ -796,7 +796,7 @@ RegisterCitusConfigVariables(void)
"and operating system name. This configuration value controls "
"whether these reports are sent."),
&EnableStatisticsCollection,
#if HAVE_LIBCURL
#ifdef HAVE_LIBCURL
true,
#else
false,
@ -892,7 +892,7 @@ NormalizeWorkerListPath(void)
static bool
StatisticsCollectionGucCheckHook(bool *newval, void **extra, GucSource source)
{
#if HAVE_LIBCURL
#ifdef HAVE_LIBCURL
return true;
#else

View File

@ -23,6 +23,7 @@
#include "access/xact.h"
#include "catalog/pg_extension.h"
#include "citus_version.h"
#include "commands/extension.h"
#include "libpq/pqsignal.h"
#include "catalog/namespace.h"
@ -312,7 +313,7 @@ CitusMaintenanceDaemonMain(Datum main_arg)
(prevStatsCollectionFailed &&
secondsSincePrevStatsCollection >= STATISTICS_COLLECTION_RETRY_INTERVAL))
{
#if HAVE_LIBCURL
#ifdef HAVE_LIBCURL
if (EnableStatisticsCollection)
{
MemoryContext statsCollectionContext =

View File

@ -10,6 +10,8 @@
#include "postgres.h"
#include "citus_version.h"
bool EnableStatisticsCollection = true; /* send basic usage statistics to Citus */
#ifdef HAVE_LIBCURL
@ -18,7 +20,6 @@ bool EnableStatisticsCollection = true; /* send basic usage statistics to Citus
#include <sys/utsname.h>
#include "access/xact.h"
#include "citus_version.h"
#include "distributed/metadata_cache.h"
#include "distributed/statistics_collection.h"
#include "distributed/worker_manager.h"

View File

@ -10,10 +10,12 @@
#ifndef STATISTICS_COLLECTION_H
#define STATISTICS_COLLECTION_H
#include "citus_version.h"
/* Config variables managed via guc.c */
extern bool EnableStatisticsCollection;
#if HAVE_LIBCURL
#ifdef HAVE_LIBCURL
#define STATS_COLLECTION_HOST "https://citus-statistics.herokuapp.com"
#define HTTP_TIMEOUT_SECONDS 5