lib/Models/ReviewFetcher.rb in ZReviewTender-0.0.7 vs lib/Models/ReviewFetcher.rb in ZReviewTender-1.0.0

- old
+ new

@@ -6,11 +6,11 @@ require "Models/Processor" require "time" class ReviewFetcher - attr_accessor :config, :platform, :processors + attr_accessor :config, :platform, :processors, :logger def execute() end @@ -29,17 +29,17 @@ if !slackProcessor.nil? slackProcessor.sendWelcomMessage(platform) end end - def setPlatformLatestCheckTimestamp() - basePath = "#{config.baseExecutePath}/.cache" + def setPlatformLatestCheckTimestamp(timestamp) + basePath = "#{config.baseExecutePath}/latestCheckTimestamp/" Helper.createDirIfNotExist(basePath) - File.open("#{basePath}/#{platform}-latestCheckTimestamp", 'w') { |file| file.write(Time.now().to_i) } + File.open("#{basePath}/#{platform}", 'w') { |file| file.write(timestamp) } end def getPlatformLatestCheckTimestamp() - filePath = "#{config.baseExecutePath}/.cache/#{platform}-latestCheckTimestamp" + filePath = "#{config.baseExecutePath}/latestCheckTimestamp/#{platform}" if File.exists?(filePath) return File.read(filePath).to_i else return 0 end \ No newline at end of file