You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
567 B

  1. #include "report_service.hpp"
  2. using namespace iflytop;
  3. using namespace core;
  4. void ReportService::initialize() {
  5. GET_TO_SERVICE(config);
  6. GET_TO_SERVICE(deviceIoService);
  7. }
  8. void ReportService::start() {
  9. logger->info("ReportService start");
  10. if (thread) return;
  11. thread.reset(new Thread("ReportService", [this]() {
  12. ThisThread thisThread;
  13. while (thisThread.getExitFlag()) {
  14. thisThread.sleepForMs(1000);
  15. }
  16. }));
  17. }
  18. void ReportService::stop() {
  19. logger->info("ReportService stop");
  20. if (thread) {
  21. thread->join();
  22. thread.reset();
  23. }
  24. }