diff --git a/.idea/vcs.xml b/.idea/vcs.xml
index 35eb1ddf..72cefee0 100644
--- a/.idea/vcs.xml
+++ b/.idea/vcs.xml
@@ -2,5 +2,8 @@
+
+
+
\ No newline at end of file
diff --git a/example/cgi/timeout.cgi b/example/cgi/timeout.cgi
new file mode 100755
index 00000000..7017f8ae
--- /dev/null
+++ b/example/cgi/timeout.cgi
@@ -0,0 +1,15 @@
+#!/bin/bash
+
+# HTTP Header
+echo "Content-Type: text/html"
+sleep 10
+echo ""
+
+# HTML Content
+echo ""
+echo "
CGI Test"
+echo ""
+echo "Hello, CGI!
"
+echo "This page was generated by a Shell script.
"
+echo ""
+echo ""
\ No newline at end of file
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 91e05b7d..ea8788b7 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -18,6 +18,8 @@ add_library(webserv_lib STATIC
lib/utils/logger.hpp
lib/utils/string.cpp
lib/utils/string.hpp
+ lib/utils/time.cpp
+ lib/utils/time.hpp
lib/utils/types/option.hpp
lib/utils/types/result.hpp
lib/utils/types/unit.hpp
diff --git a/src/lib/core/action/run_cgi_action.cpp b/src/lib/core/action/run_cgi_action.cpp
index cb675768..8c8dbc2a 100644
--- a/src/lib/core/action/run_cgi_action.cpp
+++ b/src/lib/core/action/run_cgi_action.cpp
@@ -8,6 +8,7 @@
#include "core/handler/write_cgi_request_handler.hpp"
#include "../../cgi/meta_variable.hpp"
#include "utils/fd.hpp"
+#include "utils/time.hpp"
#include "utils/logger.hpp"
void RunCgiAction::execute(ActionContext &ctx) {
@@ -134,5 +135,6 @@ void RunCgiAction::parentRoutine(const ActionContext &ctx, const int socketFd, c
ctx.getState().getEventNotifier().unregisterEvent(Event(clientFd_, Event::kWrite));
ctx.getState().getEventHandlerRepository().remove(clientFd_, Event::kRead);
ctx.getState().getEventHandlerRepository().remove(clientFd_, Event::kWrite);
- ctx.getState().getCgiProcessRepository().set(childPid, {clientFd_, socketFd});
+ CgiProcessRepository::Data data = {clientFd_, socketFd, utils::Time::getCurrentTime()};
+ ctx.getState().getCgiProcessRepository().set(childPid, data);
}
diff --git a/src/lib/core/handler/read_request_handler.cpp b/src/lib/core/handler/read_request_handler.cpp
index c0d7e673..c635870d 100644
--- a/src/lib/core/handler/read_request_handler.cpp
+++ b/src/lib/core/handler/read_request_handler.cpp
@@ -17,6 +17,9 @@ IEventHandler::InvokeResult ReadRequestHandler::invoke(const Context &ctx) {
LOG_DEBUG("start ReadRequestHandler");
const auto conn = ctx.getConnection().unwrap();
+ // アクティビティを更新
+ ctx.getConnection().unwrap().get().updateActivity();
+
ReadBuffer &readBuf = conn.get().getReadBuffer();
const Result