bio-polymarker_db_batch 0.2.0 → 0.2.1
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 +4 -4
- data/VERSION +1 -1
- data/lib/bio-polymarker_db_batch/polymarker_db_batch.rb +8 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f9b3076efa36fc6b89b3d296a559156e380d7f35
|
4
|
+
data.tar.gz: 283bc9eca6cecc30ac54526f89484fad503dd247
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2c5c9eb69c6e1af6dca1eda3e52939dfb4f2bc0ecf8bf299cd5ce9896296944333be8ee115c942bc87b4aa1c5949676113ef9a588f5491eeedd574ffa53d44b3
|
7
|
+
data.tar.gz: 2da006400b5791ac677f384f33d0f84ee1404d9c8878516762dcacfc8359862519ae285cd9d51c1ebe9d65be4d56de3434d125e3ed7d73935132ecd453efb506
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
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(
|
80
|
+
send_email(snp_file['email'],id, status)
|
74
81
|
rescue
|
75
82
|
puts "Error sending email."
|
76
83
|
end
|