extface 0.7.2 → 0.7.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/extface/handler_controller.rb +10 -4
- data/lib/extface/version.rb +1 -1
- data/test/dummy/db/test.sqlite3 +0 -0
- data/test/dummy/log/test.log +17 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e1a096752065cbf8fefb7ef4ef3e9bb54c79791cf139a14e279f94d17fb99654
|
4
|
+
data.tar.gz: 6d97c19cb4810dc78c1f203f1de13fc38761e79cc8130bbf084247252c8f6a72
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6c8a544ff4ca31742427b611abd18b813fee29e9d76d2ac81e5f8acbf0e5a6feb1d14d6851289542b1534461849d24fb6b2a5628c167fbb7e23c204496695aca
|
7
|
+
data.tar.gz: ab0be34e4579edb0dafbd8be4dbe2dc44610b715215fd781413f17a6a344e1d2826ed6185927f2eef6fbf466a790c6bf3c5db7bf00a2b18660e4784d939e24bd
|
@@ -70,14 +70,20 @@ module Extface
|
|
70
70
|
# find current job or get new one
|
71
71
|
Extface.redis_block do |r|
|
72
72
|
start = Time.now
|
73
|
+
isRetry = false
|
73
74
|
if job = device.jobs.active.find_by(id: cookies[:extface]) || device.jobs.active.try(:first)
|
74
75
|
cookies.permanent[:extface] = job.id
|
75
76
|
p "Processing job #{job.id}"
|
76
77
|
list, data = r.blpop(job.id, timeout: 1)
|
77
|
-
while data
|
78
|
-
|
79
|
-
|
80
|
-
|
78
|
+
while (data || !isRetry)
|
79
|
+
if data
|
80
|
+
response.stream.write data
|
81
|
+
r.publish(job.id, "OK")
|
82
|
+
isRetry = false
|
83
|
+
else #retry
|
84
|
+
isRetry = true
|
85
|
+
end
|
86
|
+
if (Time.now - start) > 2.8.seconds
|
81
87
|
p "############ Will continue next time"
|
82
88
|
break
|
83
89
|
end
|
data/lib/extface/version.rb
CHANGED
data/test/dummy/db/test.sqlite3
CHANGED
Binary file
|
data/test/dummy/log/test.log
CHANGED
@@ -18763,3 +18763,20 @@ Completed 200 OK in 10004ms (ActiveRecord: 3.2ms)
|
|
18763
18763
|
[1m[36mActiveRecord::InternalMetadata Load (0.2ms)[0m [1m[34mSELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? LIMIT ?[0m [["key", "environment"], ["LIMIT", 1]]
|
18764
18764
|
[1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
|
18765
18765
|
[1m[35m (0.1ms)[0m [1m[36mcommit transaction[0m
|
18766
|
+
[1m[35m (0.2ms)[0m [1m[34mSELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC[0m
|
18767
|
+
[1m[35m (126.7ms)[0m [1m[35mDROP TABLE IF EXISTS "extface_devices"[0m
|
18768
|
+
[1m[35m (0.4ms)[0m [1m[34mSELECT sqlite_version(*)[0m
|
18769
|
+
[1m[35m (85.6ms)[0m [1m[35mCREATE TABLE "extface_devices" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "uuid" varchar, "name" varchar, "extfaceable_id" integer, "extfaceable_type" varchar, "driver_id" integer, "created_at" datetime, "updated_at" datetime, "encoding" varchar)[0m
|
18770
|
+
[1m[35m (80.3ms)[0m [1m[35mDROP TABLE IF EXISTS "extface_drivers"[0m
|
18771
|
+
[1m[35m (90.3ms)[0m [1m[35mCREATE TABLE "extface_drivers" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "type" varchar, "settings" text, "created_at" datetime, "updated_at" datetime)[0m
|
18772
|
+
[1m[35m (84.1ms)[0m [1m[35mDROP TABLE IF EXISTS "extface_jobs"[0m
|
18773
|
+
[1m[35m (86.9ms)[0m [1m[35mCREATE TABLE "extface_jobs" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "device_id" integer, "created_at" datetime, "updated_at" datetime, "description" varchar, "error" varchar, "failed_at" datetime, "completed_at" datetime, "connected_at" datetime, "started_at" datetime)[0m
|
18774
|
+
[1m[35m (79.4ms)[0m [1m[35mCREATE INDEX "index_extface_jobs_on_device_id" ON "extface_jobs" ("device_id")[0m
|
18775
|
+
[1m[35m (81.0ms)[0m [1m[35mDROP TABLE IF EXISTS "extface_serial_configs"[0m
|
18776
|
+
[1m[35m (81.3ms)[0m [1m[35mCREATE TABLE "extface_serial_configs" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "driver_id" integer, "serial_boud_rate" integer, "serial_data_length" integer, "serial_parity_check" integer, "serial_stop_bits" integer, "serial_handshake" integer, "created_at" datetime, "updated_at" datetime)[0m
|
18777
|
+
[1m[35m (67.9ms)[0m [1m[35mDROP TABLE IF EXISTS "shops"[0m
|
18778
|
+
[1m[35m (114.7ms)[0m [1m[35mCREATE TABLE "shops" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime, "updated_at" datetime)[0m
|
18779
|
+
[1m[35m (0.3ms)[0m [1m[34mSELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC[0m
|
18780
|
+
[1m[36mActiveRecord::InternalMetadata Load (0.2ms)[0m [1m[34mSELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? LIMIT ?[0m [["key", "environment"], ["LIMIT", 1]]
|
18781
|
+
[1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
|
18782
|
+
[1m[35m (0.1ms)[0m [1m[36mcommit transaction[0m
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: extface
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alex Vangelov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-03-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: redis
|