lex-detect 0.1.6 → 0.1.7
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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f0a985e71fac2b9cbee47bb0f1eef3d7eb744dbbea99b573f0d90dba9ca7bc89
|
|
4
|
+
data.tar.gz: dca63d849d77bb5aa83da69ce23146a8294666c594bb155b6f3d964d7416dccc
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c8718ab255658b92ce9579815b01032afc68ded3cece3d6c13eaaaa714143203303023541ffb4b24f3d275a69004f7c043492f030b775c78b371d1edce3c76ba
|
|
7
|
+
data.tar.gz: 2695aff906451268b4733463190117c099f8c2fbb6be063003fd9ff3216db0494d0d3e265d9b8c5ebdd538b817132975dff186b37bc75f0838578b49d60e2b72
|
data/CHANGELOG.md
CHANGED
|
@@ -26,7 +26,7 @@ module Legion
|
|
|
26
26
|
|
|
27
27
|
since ||= Time.now - 60
|
|
28
28
|
db_tasks = Legion::Data.connection[:tasks]
|
|
29
|
-
.where {
|
|
29
|
+
.where { created > since }
|
|
30
30
|
.all
|
|
31
31
|
|
|
32
32
|
alerts = db_tasks.filter_map { |task| evaluate_rules(task) }
|
|
@@ -46,9 +46,9 @@ module Legion
|
|
|
46
46
|
end
|
|
47
47
|
|
|
48
48
|
def check_timeout_risk(task, expected_duration: 120)
|
|
49
|
-
return nil unless task[:status] == 'running' && task[:
|
|
49
|
+
return nil unless task[:status] == 'running' && task[:created]
|
|
50
50
|
|
|
51
|
-
elapsed = Time.now - task[:
|
|
51
|
+
elapsed = Time.now - task[:created]
|
|
52
52
|
return nil unless elapsed > (expected_duration * 2)
|
|
53
53
|
|
|
54
54
|
{
|
|
@@ -66,7 +66,7 @@ module Legion
|
|
|
66
66
|
|
|
67
67
|
count = Legion::Data.connection[:tasks]
|
|
68
68
|
.where(runner_class: task[:runner_class], status: 'failed')
|
|
69
|
-
.where {
|
|
69
|
+
.where { created > Time.now - 600 }
|
|
70
70
|
.count
|
|
71
71
|
return nil unless count >= 3
|
|
72
72
|
|
|
@@ -109,7 +109,7 @@ module Legion
|
|
|
109
109
|
runner: task[:runner_class],
|
|
110
110
|
rule: alert&.dig(:rule),
|
|
111
111
|
severity: alert&.dig(:severity),
|
|
112
|
-
duration: task[:
|
|
112
|
+
duration: task[:created] ? (Time.now - task[:created]).round(2) : nil,
|
|
113
113
|
token_cost: nil,
|
|
114
114
|
observed_at: Time.now.utc
|
|
115
115
|
)
|