navi_client 1.4.4 → 1.4.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 455132fb8d355d46bb9309a7616d6f293e640674612196f8b814c73924c40ef4
4
- data.tar.gz: f7be2fcac208fa91cbc865223741a241e4d101d43d750feddd678392cb329f47
3
+ metadata.gz: cd3a1bcce2903ec5f270821dd82c8bce372b08520a26194d0b35b2e08431aea1
4
+ data.tar.gz: a43ac149b5b35553f17314bd2b69f47c0969242959ebc0a569061344575db7c0
5
5
  SHA512:
6
- metadata.gz: 73d9a1109bcb3d6bc2167762e66304ca0189867c79faf9e609de89d935d5f6d78f113416c7323f3383caa8ce09dd2012c6ce09d7e8c863815d3a2a323909a5be
7
- data.tar.gz: 1b3c23480c58316541d482c36317c7b95b268c3bf602142902d1d04b68cffccc2c46da942904c0ca6692bf8bcaeb9c9148f8d09ca1428eff413b9eb8d6940ebb
6
+ metadata.gz: d95ca2c9f62fd8537ef68d92997df12063ce9b0726286786beb7bca54fb3a2c87460942f37f3ac045e92679647659fe0fd45ffc85ce6fd1965fdb3d7d768f523
7
+ data.tar.gz: c5702e0a9bfffd6acd685393d18519153327e0297a0dcb975ffdbc665023065c029fa5fcb8f547df345677ddc08bf8a2f270ea9855674566b949b5a687ba2c13
@@ -65,13 +65,13 @@ module NaviClient
65
65
  ##
66
66
  # send bulk request to navi-ai service with list of input files downloaded from imap server.
67
67
  #
68
- def send_request(in_filenames = [])
68
+ def send_request(in_filenames = [], is_last: false)
69
69
  unless in_filenames.blank?
70
70
  download_path = config['s3_download_folder'] + "/" + @current_user_email
71
71
  filepath = download_path + "/inputs/" + (Time.now.to_f * 1000).to_s
72
72
  filename = upload_to_s3(filepath, in_filenames.join("\n"))
73
73
 
74
- HTTPService::NaviAI.start(filepath: filename, client_id: @id, client_type: @client_type, token: @token, email: @current_user_email)
74
+ HTTPService::NaviAI.start(filepath: filename, client_id: @id, client_type: @client_type, token: @token, email: @current_user_email, is_last: is_last)
75
75
  end
76
76
  end
77
77
 
@@ -3,9 +3,9 @@ require "httparty"
3
3
  module HTTPService
4
4
  class NaviAI
5
5
 
6
- def self.start(filepath:, client_id: nil, client_type:, token:, email:)
6
+ def self.start(filepath:, client_id: nil, client_type:, token:, email:, is_last: false)
7
7
  go_url = "#{ENV['parser_url']}/v2/metas"
8
- HTTParty.post(go_url, body: { client_id: client_id, client_type: client_type, list_meta_path: filepath, token: token, email: email }.to_json, timeout: 400)
8
+ HTTParty.post(go_url, body: { client_id: client_id, client_type: client_type, list_meta_path: filepath, token: token, email: email, is_last: is_last }.to_json, timeout: 400)
9
9
  end
10
10
 
11
11
  def self.generate_csv(url, token)
@@ -108,7 +108,7 @@ module NaviClient
108
108
  ##
109
109
  # send bulk request to navi-ai service with list of input files downloaded from imap server.
110
110
  #
111
- def send_request(in_filenames = [], stamp)
111
+ def send_request(in_filenames = [], stamp, is_last: false)
112
112
  unless in_filenames.empty?
113
113
  download_path = config['download_path']
114
114
  filename = download_path + config['username'] + "/inputs/#{stamp}"
@@ -119,7 +119,7 @@ module NaviClient
119
119
  in_filenames.each { |element| f.puts(element) }
120
120
  end
121
121
 
122
- response = HTTPService::NaviAI.start(filepath: filename, client_type: @client_type, token: @token, email: config['username'])
122
+ response = HTTPService::NaviAI.start(filepath: filename, client_type: @client_type, token: @token, email: config['username'], is_last: is_last)
123
123
  return response
124
124
  end
125
125
  end
@@ -168,9 +168,10 @@ module NaviClient
168
168
 
169
169
  @logger.info "Sending Request for #{filenames.size} emails to Navi AI."
170
170
  navi_control.call(true) unless navi_control.nil?
171
- self.send_request(filenames)
171
+ stamp = (Time.now.to_f * 1000).to_s
172
+ self.send_request(filenames, stamp, true)
172
173
 
173
- HTTPService::NaviAI.generate_csv("#{@gen_csv_url}?email=#{username}", @token)
174
+ # HTTPService::NaviAI.generate_csv("#{@gen_csv_url}?email=#{username}", @token)
174
175
 
175
176
  @logger.debug "Process Completed." if @debug
176
177
  navi_control.call(false) unless navi_control.nil?
@@ -1,3 +1,3 @@
1
1
  module NaviClient
2
- VERSION = "1.4.4"
2
+ VERSION = "1.4.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: navi_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.4
4
+ version: 1.4.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sujit
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2018-05-24 00:00:00.000000000 Z
13
+ date: 2018-05-26 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: bundler