stampeded 0.3.2-x86_64-linux-gnu → 0.4.0-x86_64-linux-gnu
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/lib/stampeded/schema.rb +2 -1
- data/lib/stampeded/tasks/stampeded.rake +3 -2
- data/lib/stampeded/version.rb +1 -1
- data/libexec/libstampeded_ffi.so +0 -0
- data/libexec/stampeded +0 -0
- data/schema/schema.sql +21 -6
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: cad7f788cd761495c62f13f696e9a8b6a278fe20cddaf2973deed5fc58e1fb1f
|
|
4
|
+
data.tar.gz: 28788406522070a1ed14f54d8b855e26c7c3c0501c4b69bf6c4466d66f575807
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 47083a221b84efec03e9693cd4cc543307c9c59f35aad9772a8d43b8de48c99fb31b0a770e5ee178ba693c2505b1afba9f0a30a08018528fb51a2d0f46ee9d1e
|
|
7
|
+
data.tar.gz: bb24cac65641ca47c82780535a3325bfab125306a7d14a9ed0536d0bcabbbe77c93c76aa97335fea0820a67a8be71ffc35bd971776d57034fcdd7035432e4ede
|
data/lib/stampeded/schema.rb
CHANGED
|
@@ -39,7 +39,8 @@ module Stampeded
|
|
|
39
39
|
c.exec(<<~SQL)
|
|
40
40
|
DROP TABLE IF EXISTS stampeded_cron_occurrences, stampeded_schedules,
|
|
41
41
|
stampeded_queue_policies, stampeded_queue_counts,
|
|
42
|
-
stampeded_jobs, stampeded_workers
|
|
42
|
+
stampeded_jobs, stampeded_workers,
|
|
43
|
+
stampeded_schema CASCADE;
|
|
43
44
|
DO $$
|
|
44
45
|
DECLARE r record;
|
|
45
46
|
BEGIN
|
|
@@ -22,10 +22,11 @@ namespace :stampeded do
|
|
|
22
22
|
worker.run
|
|
23
23
|
end
|
|
24
24
|
|
|
25
|
-
desc "Run the daemon (scheduler, reaper, pruner, dashboard). Not the worker."
|
|
25
|
+
desc "Run the daemon (scheduler, reaper, pruner, dashboard). Not the worker. Upgrades the schema first."
|
|
26
26
|
task daemon: :environment do
|
|
27
27
|
require "stampeded/daemon"
|
|
28
|
-
|
|
28
|
+
# --migrate is safe on every start: it upgrades an older schema in place.
|
|
29
|
+
args = ["--no-worker", "--migrate", *ENV["STAMPEDED_ARGS"].to_s.split]
|
|
29
30
|
Stampeded::Daemon.exec!(*args, env: { "STAMPEDED_DATABASE_URL" => Stampeded.database_url_for_daemon })
|
|
30
31
|
end
|
|
31
32
|
end
|
data/lib/stampeded/version.rb
CHANGED
data/libexec/libstampeded_ffi.so
CHANGED
|
Binary file
|
data/libexec/stampeded
CHANGED
|
Binary file
|
data/schema/schema.sql
CHANGED
|
@@ -65,15 +65,20 @@ CREATE TABLE stampeded_jobs (
|
|
|
65
65
|
dedup_period text CHECK (dedup_period IN
|
|
66
66
|
('minute','hour','day','week','month')),
|
|
67
67
|
|
|
68
|
+
-- Scope, period and bucket: buckets of two periods start together (an
|
|
69
|
+
-- hour and its day at midnight UTC), so the period keeps them apart.
|
|
70
|
+
-- Joined as bytea with a raw zero byte: no `text` value can ever decode
|
|
71
|
+
-- to one (chr(0) itself is refused), so a crafted dedup_scope can never
|
|
72
|
+
-- forge the separator and so never forge another row's key.
|
|
68
73
|
dedup_key bytea GENERATED ALWAYS AS (
|
|
69
|
-
sha256(
|
|
70
|
-
dedup_scope || coalesce(
|
|
71
|
-
'
|
|
74
|
+
sha256(
|
|
75
|
+
dedup_scope::bytea || '\x00'::bytea || coalesce(
|
|
76
|
+
dedup_period::bytea || '\x00'::bytea || extract(
|
|
72
77
|
epoch FROM (date_trunc(dedup_period, inserted_at, 'UTC') - to_timestamp(0))
|
|
73
|
-
)::bigint::text,
|
|
74
|
-
''
|
|
78
|
+
)::bigint::text::bytea,
|
|
79
|
+
''::bytea
|
|
75
80
|
)
|
|
76
|
-
)
|
|
81
|
+
)
|
|
77
82
|
) STORED,
|
|
78
83
|
|
|
79
84
|
failure_kind text,
|
|
@@ -1047,3 +1052,13 @@ CREATE TABLE stampeded_queue_policies (
|
|
|
1047
1052
|
created_at timestamptz NOT NULL DEFAULT now(),
|
|
1048
1053
|
updated_at timestamptz NOT NULL DEFAULT now()
|
|
1049
1054
|
);
|
|
1055
|
+
|
|
1056
|
+
-- Which schema this database holds, one row: `stampeded::schema::migrate`
|
|
1057
|
+
-- upgrades from it and refuses one newer than itself. Raised by each upgrade.
|
|
1058
|
+
CREATE TABLE stampeded_schema (
|
|
1059
|
+
version integer NOT NULL CHECK (version > 0),
|
|
1060
|
+
changed_at timestamptz NOT NULL DEFAULT now()
|
|
1061
|
+
);
|
|
1062
|
+
CREATE UNIQUE INDEX stampeded_schema_one_row ON stampeded_schema ((true));
|
|
1063
|
+
-- Must match schema::VERSION.
|
|
1064
|
+
INSERT INTO stampeded_schema (version) VALUES (3);
|