jgrouper 0.4.0 → 0.4.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.
- data/HISTORY.md +6 -0
- data/lib/jgrouper/audit_archiver.rb +11 -4
- data/lib/jgrouper/version.rb +1 -1
- metadata +2 -2
data/HISTORY.md
CHANGED
@@ -1,6 +1,12 @@
|
|
1
1
|
JGrouper History
|
2
2
|
================
|
3
3
|
|
4
|
+
2013-07-18 JGrouper v0.4.1
|
5
|
+
--------------------------
|
6
|
+
* Update "JGrouper::AuditArchiver" to detect re-archive attempts and increment date
|
7
|
+
* Update "JGrouper::AuditArchiver" earliest entry detection (again)
|
8
|
+
|
9
|
+
|
4
10
|
2013-07-05 JGrouper v0.4.0
|
5
11
|
--------------------------
|
6
12
|
* Add "--batch-size NUMBER" to "jgrouper-audit-archiver"
|
@@ -60,12 +60,18 @@ module JGrouper # :nodoc:
|
|
60
60
|
|
61
61
|
connect do
|
62
62
|
mappings do
|
63
|
+
last_date = nil
|
63
64
|
1.upto @number_of_days do
|
64
|
-
@date = oldest_entry
|
65
|
+
@date = oldest_entry # Date of oldest entry
|
66
|
+
if @date == last_date
|
67
|
+
warn "WARNING: attempt to re-archive #{ @date }, moving one day forward..."
|
68
|
+
@date = @date + 1
|
69
|
+
end
|
65
70
|
break if stop?
|
66
71
|
|
67
72
|
start_at = time_to_microseconds @date.to_time # @date start-of-day
|
68
73
|
stop_at = time_to_microseconds ( @date + 1 ).to_time - 1 # @date end-of-day
|
74
|
+
# TODO Verify number of entries is greater than 0?
|
69
75
|
|
70
76
|
num_entries = 0
|
71
77
|
entries = []
|
@@ -112,7 +118,8 @@ module JGrouper # :nodoc:
|
|
112
118
|
|
113
119
|
prune(entries, num_entries, total_entries) unless entries.empty?
|
114
120
|
log "archiving #{ @date } (#{num_entries}/#{total_entries} entries) - done"
|
115
|
-
|
121
|
+
|
122
|
+
last_date = @date
|
116
123
|
end
|
117
124
|
end
|
118
125
|
end
|
@@ -266,8 +273,8 @@ module JGrouper # :nodoc:
|
|
266
273
|
stmt = @conn.create_statement
|
267
274
|
rs = stmt.execute_query "SELECT MIN(created_on) FROM #{GROUPER_AUDIT_ENTRY} ORDER BY created_on"
|
268
275
|
while rs.next
|
269
|
-
# Microseconds -> Seconds -> Time -> Date
|
270
|
-
d = Time.at( microseconds_to_seconds( rs.get_object(1).to_s.to_f ) ).to_date
|
276
|
+
# String Microseconds -> Float Microseconds -> Round Up -> Seconds -> Time -> Date
|
277
|
+
d = Time.at( microseconds_to_seconds( rs.get_object(1).to_s.to_f.ceil ) ).to_date
|
271
278
|
break
|
272
279
|
end
|
273
280
|
rs.close
|
data/lib/jgrouper/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jgrouper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-07-
|
12
|
+
date: 2013-07-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: jruby-jars
|