diff --git a/http/app.h b/http/app.h
index b810374..2eca4d2 100644
--- a/http/app.h
+++ b/http/app.h
@@ -27,8 +27,6 @@
 class App
 {
   public:
-    using self_t = App;
-
 #ifdef BMCWEB_ENABLE_SSL
     using ssl_socket_t = boost::beast::ssl_stream<boost::asio::ip::tcp::socket>;
     using ssl_server_t = Server<App, ssl_socket_t>;
@@ -68,19 +66,19 @@
         return router.newRuleTagged<Tag>(std::move(rule));
     }
 
-    self_t& socket(int existing_socket)
+    App& socket(int existing_socket)
     {
         socketFd = existing_socket;
         return *this;
     }
 
-    self_t& port(std::uint16_t port)
+    App& port(std::uint16_t port)
     {
         portUint = port;
         return *this;
     }
 
-    self_t& bindaddr(std::string bindaddr)
+    App& bindaddr(std::string bindaddr)
     {
         bindaddrStr = bindaddr;
         return *this;
@@ -105,7 +103,6 @@
             sslServer =
                 std::make_unique<ssl_server_t>(this, socketFd, sslContext, io);
         }
-        sslServer->setTickFunction(tickInterval, tickFunction);
         sslServer->run();
 
 #else
@@ -120,7 +117,6 @@
             server = std::move(
                 std::make_unique<server_t>(this, socketFd, nullptr, io));
         }
-        server->setTickFunction(tickInterval, tickFunction);
         server->run();
 
 #endif
@@ -148,8 +144,8 @@
     }
 
 #ifdef BMCWEB_ENABLE_SSL
-    self_t& sslFile(const std::string& crt_filename,
-                    const std::string& key_filename)
+    App& sslFile(const std::string& crt_filename,
+                 const std::string& key_filename)
     {
         sslContext = std::make_shared<ssl_context_t>(
             boost::asio::ssl::context::tls_server);
@@ -164,7 +160,7 @@
         return *this;
     }
 
-    self_t& sslFile(const std::string& pem_filename)
+    App& sslFile(const std::string& pem_filename)
     {
         sslContext = std::make_shared<ssl_context_t>(
             boost::asio::ssl::context::tls_server);
@@ -178,7 +174,7 @@
         return *this;
     }
 
-    self_t& ssl(std::shared_ptr<boost::asio::ssl::context>&& ctx)
+    App& ssl(std::shared_ptr<boost::asio::ssl::context>&& ctx)
     {
         sslContext = std::move(ctx);
         BMCWEB_LOG_INFO << "app::ssl context use_count="
@@ -190,7 +186,7 @@
 
 #else
     template <typename T, typename... Remain>
-    self_t& ssl_file(T&&, Remain&&...)
+    App& ssl_file(T&&, Remain&&...)
     {
         // We can't call .ssl() member function unless BMCWEB_ENABLE_SSL is
         // defined.
@@ -202,7 +198,7 @@
     }
 
     template <typename T>
-    self_t& ssl(T&&)
+    App& ssl(T&&)
     {
         // We can't call .ssl() member function unless BMCWEB_ENABLE_SSL is
         // defined.
@@ -214,14 +210,6 @@
     }
 #endif
 
-    template <typename Duration, typename Func>
-    self_t& tick(Duration d, Func f)
-    {
-        tickInterval = std::chrono::duration_cast<std::chrono::milliseconds>(d);
-        tickFunction = f;
-        return *this;
-    }
-
   private:
     std::shared_ptr<asio::io_context> io;
 #ifdef BMCWEB_ENABLE_SSL
@@ -233,9 +221,6 @@
     int socketFd = -1;
     Router router;
 
-    std::chrono::milliseconds tickInterval{};
-    std::function<void()> tickFunction;
-
 #ifdef BMCWEB_ENABLE_SSL
     std::unique_ptr<ssl_server_t> sslServer;
 #else
diff --git a/http/http_server.h b/http/http_server.h
index b5fd4da..422b3a7 100644
--- a/http/http_server.h
+++ b/http/http_server.h
@@ -37,8 +37,8 @@
                std::make_shared<boost::asio::io_context>()) :
         ioService(std::move(io)),
         acceptor(std::move(acceptorIn)),
-        signals(*ioService, SIGINT, SIGTERM, SIGHUP), tickTimer(*ioService),
-        timer(*ioService), handler(handlerIn), adaptorCtx(adaptor_ctx)
+        signals(*ioService, SIGINT, SIGTERM, SIGHUP), timer(*ioService),
+        handler(handlerIn), adaptorCtx(adaptor_ctx)
     {}
 
     Server(Handler* handlerIn, const std::string& bindaddr, uint16_t port,
@@ -62,26 +62,6 @@
                adaptor_ctx, io)
     {}
 
-    void setTickFunction(std::chrono::milliseconds d, std::function<void()> f)
-    {
-        tickInterval = d;
-        tickFunction = f;
-    }
-
-    void onTick()
-    {
-        tickFunction();
-        tickTimer.expires_after(
-            std::chrono::milliseconds(tickInterval.count()));
-        tickTimer.async_wait([this](const boost::system::error_code& ec) {
-            if (ec)
-            {
-                return;
-            }
-            onTick();
-        });
-    }
-
     void updateDateStr()
     {
         time_t lastTimeT = time(nullptr);
@@ -125,19 +105,6 @@
         };
         timer.async_wait(timerHandler);
 
-        if (tickFunction && tickInterval.count() > 0)
-        {
-            tickTimer.expires_after(
-                std::chrono::milliseconds(tickInterval.count()));
-            tickTimer.async_wait([this](const boost::system::error_code& ec) {
-                if (ec)
-                {
-                    return;
-                }
-                onTick();
-            });
-        }
-
         BMCWEB_LOG_INFO << serverName << " server is running, local endpoint "
                         << acceptor->local_endpoint();
         startAsyncWaitForSignal();
@@ -258,7 +225,6 @@
     std::function<std::string()> getCachedDateStr;
     std::unique_ptr<tcp::acceptor> acceptor;
     boost::asio::signal_set signals;
-    boost::asio::steady_timer tickTimer;
     boost::asio::steady_timer timer;
 
     std::string dateStr;
@@ -266,8 +232,6 @@
     Handler* handler;
     std::string serverName = "bmcweb";
 
-    std::chrono::milliseconds tickInterval{};
-    std::function<void()> tickFunction;
     std::function<void(const boost::system::error_code& ec)> timerHandler;
 
 #ifdef BMCWEB_ENABLE_SSL
