bio-polymarker_db_batch 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: da45b3e074939e929a4f033239ea1266513885e6
4
- data.tar.gz: 4d5a1811ae63656af0180ca532b6618048c371e1
3
+ metadata.gz: f9b3076efa36fc6b89b3d296a559156e380d7f35
4
+ data.tar.gz: 283bc9eca6cecc30ac54526f89484fad503dd247
5
5
  SHA512:
6
- metadata.gz: 8a0df21c2eaf9d19fdcf5df49248415b88931f2197139f1a3cef62c776cda476008518f56b42f9e5b7ea1601a87d0fb67117ed7122ead257589dcf97457620cd
7
- data.tar.gz: 379bc02e20d8599eb2a88deb2e037a51d8043a125217d8ff3fa07376bd11a42b034a65aff544771d4e143c0bd8b0f6acecb79b73c59e4cde3db3144ee46ecb77
6
+ metadata.gz: 2c5c9eb69c6e1af6dca1eda3e52939dfb4f2bc0ecf8bf299cd5ce9896296944333be8ee115c942bc87b4aa1c5949676113ef9a588f5491eeedd574ffa53d44b3
7
+ data.tar.gz: 2da006400b5791ac677f384f33d0f84ee1404d9c8878516762dcacfc8359862519ae285cd9d51c1ebe9d65be4d56de3434d125e3ed7d73935132ecd453efb506
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.0
1
+ 0.2.1
@@ -10,6 +10,11 @@ class Bio::DB::Polymarker
10
10
  def mysql_version
11
11
  con.get_server_info
12
12
  end
13
+
14
+ def get_snp_file(id)
15
+ results = con.query "SELECT * FROM snp_file WHERE snp_file_id=#{id}"
16
+ results.fetch_hash
17
+ end
13
18
 
14
19
  def each_to_run
15
20
  query="SELECT snp_file_id, filename FROM snp_file WHERE status = 'NEW';"
@@ -66,11 +71,13 @@ class Bio::DB::Polymarker
66
71
 
67
72
  def update_status(snp_file_id, new_status)
68
73
  raise "Invalid status #{new_status}" unless ["NEW", "SUBMITTED", "RUNNING", "DONE", "ERROR"].include?(new_status)
74
+ snp_file = get_snp_file(snp_file_id)
75
+ return if snp_file['status'] == new_status
69
76
  pst = con.prepare "UPDATE snp_file SET status = ? WHERE snp_file_id = ?"
70
77
  pst.execute new_status, snp_file_id
71
78
  con.commit
72
79
  begin
73
- send_email(to,id, status)
80
+ send_email(snp_file['email'],id, status)
74
81
  rescue
75
82
  puts "Error sending email."
76
83
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bio-polymarker_db_batch
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ricardo H. Ramirez-Gonzalez