ywkaras commented on a change in pull request #8689:
URL: https://github.com/apache/trafficserver/pull/8689#discussion_r827257257



##########
File path: proxy/HostStatus.h
##########
@@ -168,6 +175,35 @@ struct HostStatRec {
   }
 };
 
+struct HostStatusSync;
+typedef int (HostStatusSync::*HostStatusSyncHandler)(int, void *);
+struct HostStatusSync : public Continuation {
+  std::string hostRecordsFile;
+
+  void sync_task();
+  void
+  getHostStatusPersistentFilePath()
+  {
+    std::string rundir(RecConfigReadRuntimeDir());
+    hostRecordsFile = Layout::relative_to(rundir, ts::filename::HOST_RECORDS);
+  }
+
+public:
+  HostStatusSync()
+  {
+    getHostStatusPersistentFilePath();
+
+    SET_HANDLER((HostStatusSyncHandler)&HostStatusSync::mainEvent);

Review comment:
       You should not need to cast the type of the event function anymore 
because of https://github.com/apache/trafficserver/pull/6996 .
   
   It is best to not use C casts in new code.  A C cast is equivalent to 
reinterpret_cast and is hard to find with grep.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to