miga-base 1.1.1.1 → 1.1.2.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8bbb058ee0094bdbf36ddd5e93d8206871de2a774876ad1229d8e681e5a8aa38
4
- data.tar.gz: 5091f3d1053ae79d02056dddc3eda5cd48c061f5bbd6c78ef185e5f9e24b0d92
3
+ metadata.gz: 2a98a1a14ae95edb9235f4fa87431f503443e75288e63448758eda076ad89f20
4
+ data.tar.gz: 1dd1771501ac7935466a0255161bb50c75bc47376e80c595b11033f0c1a53cd6
5
5
  SHA512:
6
- metadata.gz: 80383eefa8cba0b17b3f21ad6b5d9880acc47e349687dc76c531b01111e665fa2ff144507f5925ca81c70eb642286724b7c2be51531c4b31b1710e5430341f6f
7
- data.tar.gz: dba9c4d31acab4e50e40d802b10a9268be1a291e99ada00de11fefcacf183aa2a381842980030832fe77db94169239731c9b8a7b264d37d72c3fd8ece4774848
6
+ metadata.gz: 0c895fafe9bc993a28b73cf0383b6f6522ed44d8ffdf7845d381ddb1f7c06d10edf31aaae8929212d1706dda2af8b3cbacc5f334a449331adafb513b55ff1c31
7
+ data.tar.gz: 892116a76fa3ff29cd396f961ed30a07c41322fcc0ecf301a70b5d8b1e0d68009ac27be7ab360d6441c8189ae8b191f450cd654c556c9b7771d604b1ca976211
@@ -4,7 +4,7 @@
4
4
  # Helper module with files configuration functions for MiGA::Cli::Action::Init
5
5
  module MiGA::Cli::Action::Init::FilesHelper
6
6
  def open_rc_file
7
- rc_path = File.expand_path('.miga_rc', ENV['HOME'])
7
+ rc_path = File.expand_path('.miga_rc', ENV['MIGA_HOME'])
8
8
  if File.exist? rc_path
9
9
  if cli.ask_user(
10
10
  'I found a previous configuration. Do you want to continue?',
@@ -12,9 +12,10 @@ module MiGA::Daemon::Base
12
12
  k = k.to_sym
13
13
  unless v.nil?
14
14
  case k
15
- when :latency, :maxjobs, :ppn, :ppn_project, :format_version, :verbosity
15
+ when :latency, :maxjobs, :ppn, :ppn_project, :format_version, :verbosity,
16
+ :skip_maintenance
16
17
  v = v.to_i
17
- if !force && v == 0 && k != :verbosity
18
+ if !force && v == 0 && !%i[verbosity skip_maintenance].include?(k)
18
19
  raise "Daemon's #{k} cannot be set to zero"
19
20
  end
20
21
  when :shutdown_when_done, :show_log, :bypass_maintenance
@@ -50,6 +51,12 @@ module MiGA::Daemon::Base
50
51
  runopts(:nodelist)
51
52
  end
52
53
 
54
+ ##
55
+ # Returns the number of times maintenance should be skipped before running
56
+ def skip_maintenance
57
+ runopts(:skip_maintenance) || 0
58
+ end
59
+
53
60
  ##
54
61
  # Returns the running option +opt+ in jobs for +what+. +what+ can be
55
62
  # +:dataset+ or +:projects+
data/lib/miga/daemon.rb CHANGED
@@ -93,7 +93,7 @@ class MiGA::Daemon < MiGA::MiGA
93
93
  flush!
94
94
  if (loop_i % 12).zero?
95
95
  purge!
96
- queue_maintenance
96
+ queue_maintenance if (loop_i % (12 * (skip_maintenance + 1))).zero?
97
97
  end
98
98
  save_status
99
99
  sleep(latency)
data/lib/miga/dataset.rb CHANGED
@@ -107,7 +107,7 @@ class MiGA::Dataset < MiGA::MiGA
107
107
  metadata[:warn] = "Inactive: #{reason}" unless reason.nil?
108
108
  metadata[:inactive] = true
109
109
  metadata.save
110
- project.recalculate_tasks('Reference dataset inactivated') if ref?
110
+ project.recalculate_tasks("Reference dataset inactivated: #{name}") if ref?
111
111
  pull_hook :on_inactivate
112
112
  end
113
113
 
@@ -117,7 +117,7 @@ class MiGA::Dataset < MiGA::MiGA
117
117
  metadata[:inactive] = nil
118
118
  metadata[:warn] = nil if metadata[:warn] && metadata[:warn] =~ /^Inactive: /
119
119
  metadata.save
120
- project.recalculate_tasks('Reference dataset activated') if ref?
120
+ project.recalculate_tasks("Reference dataset activated: #{name}") if ref?
121
121
  pull_hook :on_activate
122
122
  end
123
123
 
@@ -52,7 +52,9 @@ module MiGA::Project::Dataset
52
52
  @metadata[:datasets] << name
53
53
  @dataset_names_hash = nil # Ensure loading even if +do_not_save+ is true
54
54
  save
55
- recalculate_tasks('New reference dataset added') if d.ref? && d.active?
55
+ if d.ref? && d.active?
56
+ recalculate_tasks("Reference dataset added: #{d.name}")
57
+ end
56
58
  pull_hook(:on_add_dataset, name)
57
59
  end
58
60
  dataset(name)
@@ -66,7 +68,9 @@ module MiGA::Project::Dataset
66
68
 
67
69
  self.metadata[:datasets].delete(name)
68
70
  save
69
- recalculate_tasks('Reference dataset unlinked') if d.ref? && d.active?
71
+ if d.ref? && d.active?
72
+ recalculate_tasks("Reference dataset unlinked: #{d.name}")
73
+ end
70
74
  pull_hook(:on_unlink_dataset, name)
71
75
  d
72
76
  end
data/lib/miga/version.rb CHANGED
@@ -12,7 +12,7 @@ module MiGA
12
12
  # - String indicating release status:
13
13
  # - rc* release candidate, not released as gem
14
14
  # - [0-9]+ stable release, released as gem
15
- VERSION = [1.1, 1, 1].freeze
15
+ VERSION = [1.1, 2, 3].freeze
16
16
 
17
17
  ##
18
18
  # Nickname for the current major.minor version.
@@ -20,7 +20,7 @@ module MiGA
20
20
 
21
21
  ##
22
22
  # Date of the current gem relese.
23
- VERSION_DATE = Date.new(2021, 10, 29)
23
+ VERSION_DATE = Date.new(2021, 11, 16)
24
24
 
25
25
  ##
26
26
  # References of MiGA
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: miga-base
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1.1
4
+ version: 1.1.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luis M. Rodriguez-R
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-10-29 00:00:00.000000000 Z
11
+ date: 2021-11-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: daemons