Remove almost redundant update code
authorThomas Jarosch <thomas.jarosch@intra2net.com>
Wed, 6 Oct 2010 13:22:49 +0000 (15:22 +0200)
committerThomas Jarosch <thomas.jarosch@intra2net.com>
Wed, 6 Oct 2010 13:22:49 +0000 (15:22 +0200)
src/logger.cpp
src/logger.hpp
src/updater.cpp

index cc507c0..e94822a 100644 (file)
@@ -1667,24 +1667,6 @@ void Logger::print_cached_dns_entry(const string& hostname, const string& ip_dns
 
 
 /**
- * Updating service for the first time.
- * @param hostname Hostname
- * @param ip_dns_recheck Cached DNS entry
- * @param ip_host Hosts IP
- */
-void Logger::print_update_service_firttime(const string& hostname, const string& ip_dns_recheck, const string& ip_host) const
-{
-    int level = 1;
-    if ( level <= Loglevel )
-    {
-        ostringstream msg;
-        msg << "Updating service for the first time. Hostname: " << hostname << " DNS-Record: " << ip_dns_recheck << " Hosts IP: " << ip_host << endl;
-        log_notice(msg.str());
-    }
-}
-
-
-/**
  * Updating service
  * @param hostname Hostname
  * @param ip_dns_recheck Cached DNS entry
index d3c82ec..9c95b8e 100644 (file)
@@ -246,8 +246,6 @@ public:
 
     void print_cached_dns_entry(const std::string& hostname, const std::string& ip_dns_recheck, const std::string& ip_last_update, const std::string& ip_host) const;
 
-    void print_update_service_firttime(const std::string& hostname, const std::string& ip_dns_recheck, const std::string& ip_host) const;
-
     void print_update_service(const std::string& hostname, const std::string& ip_dns_recheck, const std::string& ip_last_update, const std::string& ip_host, const time_t lastupdated) const;
 
     void print_update_service_ttl_expired(const std::string& hostname, const std::string& ip_dns_recheck, const std::string& ip_last_update, const std::string& ip_host, const time_t lastupdated, const int dns_cache_ttl, const time_t current_time) const;
index be6d29a..07881f4 100644 (file)
@@ -259,17 +259,6 @@ void Updater::update_services() const
             continue;
         }
 
-        // Check if the service will be updated for the first time.
-        if ( lastupdated == 0 )
-        {
-            // Update for the firt time.
-            Log->print_update_service_firttime(hostname, ip_dns_recheck, ip_host);
-            service->update(ip_host,current_time);
-
-            // Update done, go to next service
-            continue;
-        }
-
         // We already have updated, check if the IP set in last update differs from the actual host's ip.
         if ( ip_last_update != ip_host )
         {