From 0702e581a1a75223c47c87ab1dadc998c4a13c97 Mon Sep 17 00:00:00 2001 From: Grant Limberg Date: Fri, 4 Jun 2021 11:06:54 -0700 Subject: [PATCH] remove some noisy log lines & fix a query error --- controller/DB.cpp | 2 -- controller/EmbeddedNetworkController.cpp | 2 +- controller/PostgreSQL.cpp | 4 +--- controller/PostgreSQL.hpp | 2 -- 4 files changed, 2 insertions(+), 8 deletions(-) diff --git a/controller/DB.cpp b/controller/DB.cpp index d4bd34eb4..a13589b72 100644 --- a/controller/DB.cpp +++ b/controller/DB.cpp @@ -197,7 +197,6 @@ void DB::networks(std::set &networks) void DB::_memberChanged(nlohmann::json &old,nlohmann::json &memberConfig,bool notifyListeners) { - fprintf(stderr, "DB::_memberChanged\n"); uint64_t memberId = 0; uint64_t networkId = 0; bool isAuth = false; @@ -313,7 +312,6 @@ void DB::_memberChanged(nlohmann::json &old,nlohmann::json &memberConfig,bool no void DB::_networkChanged(nlohmann::json &old,nlohmann::json &networkConfig,bool notifyListeners) { - fprintf(stderr, "DB::_networkChanged\n"); if (networkConfig.is_object()) { const std::string ids = networkConfig["id"]; const uint64_t networkId = Utils::hexStrToU64(ids.c_str()); diff --git a/controller/EmbeddedNetworkController.cpp b/controller/EmbeddedNetworkController.cpp index 2df851706..4ce6d2343 100644 --- a/controller/EmbeddedNetworkController.cpp +++ b/controller/EmbeddedNetworkController.cpp @@ -1336,7 +1336,7 @@ void EmbeddedNetworkController::_request( std::string memberId = member["id"]; fprintf(stderr, "ssoEnabled && !ssoExempt %s-%s\n", nwids, memberId.c_str()); int64_t authenticationExpiryTime = (int64_t)OSUtils::jsonInt(member["authenticationExpiryTime"], 0); - fprintf(stder, "authExpiryTime: %l\n", authenticationExpiryTime); + fprintf(stderr, "authExpiryTime: %l\n", authenticationExpiryTime); if ((authenticationExpiryTime == 0) || (authenticationExpiryTime < now)) { Dictionary<1024> authInfo; diff --git a/controller/PostgreSQL.cpp b/controller/PostgreSQL.cpp index 55f3c03dd..630143ad3 100644 --- a/controller/PostgreSQL.cpp +++ b/controller/PostgreSQL.cpp @@ -332,7 +332,7 @@ std::string PostgreSQL::getSSOAuthURL(const nlohmann::json &member) // find an unused nonce, if one exists. pqxx::result r = w.exec_params("SELECT nonce FROM ztc_sso_expiry " - "WHERE network_id = $1 AND member_id = $2 AND " + "WHERE network_id = $1 AND member_id = $2 " "AND authentication_expiry_time IS NULL AND ((NOW() AT TIME ZONE 'UTC') <= nonce_expiry", networkId, memberId); @@ -544,7 +544,6 @@ void PostgreSQL::initializeNetworks() } _networkChanged(empty, config, false); - fprintf(stderr, "Initialized Network: %s\n", nwid.c_str()); } w.commit(); @@ -706,7 +705,6 @@ void PostgreSQL::initializeMembers() } _memberChanged(empty, config, false); - fprintf(stderr, "Initialzed member %s-%s\n", networkId.c_str(), memberId.c_str()); } w.commit(); diff --git a/controller/PostgreSQL.hpp b/controller/PostgreSQL.hpp index 5e4b32ddd..6e5e8a97b 100644 --- a/controller/PostgreSQL.hpp +++ b/controller/PostgreSQL.hpp @@ -115,12 +115,10 @@ protected: inline std::size_t operator()(const std::pair &p) const { return (std::size_t)(p.first ^ p.second); } }; virtual void _memberChanged(nlohmann::json &old,nlohmann::json &memberConfig,bool notifyListeners) { - fprintf(stderr, "PostgreSQL::_memberChanged\n"); DB::_memberChanged(old, memberConfig, notifyListeners); } virtual void _networkChanged(nlohmann::json &old,nlohmann::json &networkConfig,bool notifyListeners) { - fprintf(stderr, "PostgreSQL::_networkChanged\n"); DB::_networkChanged(old, networkConfig, notifyListeners); }