mirror of
https://github.com/yawaflua/SpCloudCore.git
synced 2025-12-10 04:29:35 +02:00
Change scope of file processing and adjust di in publish contoller
This commit is contained in:
@@ -6,15 +6,18 @@
|
||||
#include <thread>
|
||||
#include <sys/stat.h>
|
||||
#include "CommandService.cpp"
|
||||
#include "Logger.cpp"
|
||||
//#include <Poco/Mutex.h>
|
||||
//#include <Poco/Path.h>
|
||||
//#include <Poco/FileStr*/eam.h >
|
||||
class FileProcessingService
|
||||
{
|
||||
|
||||
public:
|
||||
FileProcessingService(/*&Logger logger*/)
|
||||
FileProcessingService(Logger& logger) : logger_(logger)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
bool save_file(const std::string& filename, const std::string& content) {
|
||||
@@ -25,8 +28,9 @@ public:
|
||||
|
||||
if (!ofs) return false;
|
||||
|
||||
ofs << content;
|
||||
logger_.log(INFO, "Start saving file");
|
||||
|
||||
ofs << content;
|
||||
|
||||
return ofs.good();
|
||||
}
|
||||
@@ -136,4 +140,5 @@ public:
|
||||
/*private:
|
||||
std::mutex file_mutex; */// Мьютекс для синхронизации доступа к файлу
|
||||
|
||||
Logger& logger_;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user