garbageman 0.2.7 → 0.2.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NmM0NDc0NGU5MTVhODlkZDM5ZTkyNzE5NDI5MDk2NjFjYTRjNWRiZA==
4
+ YzY1ZjFmY2IxYjJhMzc0ZTNjNzdjNmFlZjBiNWY4ZmU5YmZjYTBiYw==
5
5
  data.tar.gz: !binary |-
6
- MTE2NWEyYTUwMmQ3ZDI4ZmQzMWEyNmM5YWVmNzFmYjk2M2ZiNGM1ZA==
6
+ ODQ1ODFhNDEzYTM0MzFmMGI5NjI4YTFiNDZkYWI5MmRmNDU0MDY1OQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- YmNjNzNkODUxYzJkYzQ0ODVjYzVkMjBkM2FlMDE1Y2JmZDEyNjY1OTE0NmVl
10
- MmIzNzRjMmY3OTI3MjRjMTE3ZmJmZjQzM2RmYmY5ZGU4MjBiZjc5YzgyMGUw
11
- MDNjMmU0ZTNmMTI1YTVlMmZhZjFmNjdmYTY5N2EwMzFkMjAxNDk=
9
+ OWQwOTFlMjhlOWY0NzA4Y2VhYWJiZTFmNDYwOTNmYzY0OWZiNDQ0NDAwZWFi
10
+ YWIxZDNmOWMwYzk2YzU4ZjU4ZDEwNWI4NjljYTIxNGIyYTUyZjE5OGNmOGIx
11
+ ODBjNDgwZjMyZTYyNjAyZWM4YTcxNTI2NWVmYjcwNGRmZDRjNTA=
12
12
  data.tar.gz: !binary |-
13
- ZGJjZjVlZTk2NTYxZjE5ZDA3NTQ2ZTU1YWNlZmRiMWNiZWE4Y2RhZThlNmZk
14
- M2M1ODI1NDFmMGExMDM4YzdkMjJiYzdhYmI5ZjgyYjY4MzdiZjFiMTBmYmM2
15
- ZWRiNzIzNjFlZDM4ZjRmNDk0YzI3ZjUyYmQ0ZThmMmM4ZjRiZjU=
13
+ OTA4MGRhZTFmZmRmZGUxZjYxYzBhODQ5NjQxMGQ3ZmMxZmJiNjlkNGJlNWM5
14
+ ODJjMWJkZTE2YjhmZjdjMWUwZDcwNWVhYWZhOTNkYjU0Y2UyMTk1NjkyNTJl
15
+ MDk4ODA1ZTFkZjYzYjM0ZDZhZWMwMGE2ZDY3NTZiNTk0ZjEwODM=
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.7
1
+ 0.2.8
data/garbageman.gemspec CHANGED
@@ -2,11 +2,11 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: garbageman 0.2.7 ruby lib
5
+ # stub: garbageman 0.2.8 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "garbageman"
9
- s.version = "0.2.7"
9
+ s.version = "0.2.8"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib"]
@@ -84,7 +84,9 @@ module GarbageMan
84
84
  return
85
85
  end
86
86
  end
87
-
87
+
88
+ File.open(Config.gc_last_collected_file, 'w') { |f| f.write Time.now.to_i.to_s }
89
+
88
90
  before_gc_callbacks.each(&:call)
89
91
 
90
92
  write_gc_yaml server_index, STARTING
@@ -159,7 +161,7 @@ module GarbageMan
159
161
  WRITE_MOVE_OPTIONS = {:force => true}
160
162
  def write_gc_yaml(index, status)
161
163
  config = {'gc' => {'server' => index, 'status' => status}}
162
- File.open(Config.gc_yaml_tmp_file, 'w+') { |f| f.write config.to_yaml }
164
+ File.open(Config.gc_yaml_tmp_file, 'w') { |f| f.write config.to_yaml }
163
165
  # atomic write
164
166
  FileUtils.mv Config.gc_yaml_tmp_file, Config.gc_yaml_file, WRITE_MOVE_OPTIONS
165
167
  end
@@ -11,6 +11,10 @@ module GarbageMan
11
11
  def self.gc_yaml_tmp_file; @@gc_yaml_tmp_file ||= "./data/.tmp.gc.yml"; end
12
12
  def self.gc_yaml_tmp_file=(file); @@gc_yaml_tmp_file = file; end
13
13
 
14
+ @@gc_last_collected_file = nil
15
+ def self.gc_last_collected_file; @@gc_last_collected_file ||= "./data/gc-last-collection-time.timestamp"; end
16
+ def self.gc_last_collected_file=(file); @@gc_last_collected_file = file; end
17
+
14
18
  def self.gc_config
15
19
  begin
16
20
  File.exists?(self.gc_yaml_file) ? YAML.load_file(self.gc_yaml_file) : nil
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: garbageman
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.7
4
+ version: 0.2.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Doug Youch