viewy 0.1.2 → 0.2.0

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
  SHA1:
3
- metadata.gz: 5eff5c5e346be1ca5ab408f4b37431d8af0b102a
4
- data.tar.gz: 4699cfb5e13e4331e455f6e970afceb566050e30
3
+ metadata.gz: 10ba4105cac09813ce262177ec5459640bbb46da
4
+ data.tar.gz: 910730e222b89864e39ea3ba474065e1b7c6dd6d
5
5
  SHA512:
6
- metadata.gz: 763d4f573e981231058164708e19507e82e904093a7f095cde7aabf27e3dd335e381dba3a2d7e6701bc31ddf4d5362e0dedd10c59cb8bfe145ae0cc6d6e2401a
7
- data.tar.gz: 673a0b105715622bc7a8966a777f7855073ce9d5a42daab3ca4780757a6ccec6636e64c9fd482c0a9b07361df2390c5f82e755cced92eeecb08c86cc2b44916e
6
+ metadata.gz: f47a589a5e89e064361d57cae35f919b33ca3cdc3fc5e1e65da798a804a6fac07334f1414d64352a73498a874fba45890ad9bda5b61971627204684dad450029
7
+ data.tar.gz: 51e79f941b575721cc39f300517bfff4e7805b48aca4bb73252280c6ed5ba7c24aa4939f00285985c79377cb5b79848c9b2ccf024cc4f0c4e7cefe125a28f0fe
@@ -54,13 +54,18 @@ module Viewy
54
54
  # @param ex [ActiveRecord::StatementInvalid] an exception raised during the view refresh
55
55
  # @param concurrently [Boolean] whether or not the refresh that raised the exception was concurrent
56
56
  #
57
- # @raise [ActiveRecord::StatementInvalid] re-raised if the original exception is not a FeatureNotSupported exception
57
+ # @raise [ActiveRecord::StatementInvalid] re-raised if the original exception does not indicate the refresh
58
+ # should be retried non-concurrently
58
59
  #
59
60
  # @return [Boolean] true if the system should attempt to refresh the view non-concurrently after a concurrent
60
61
  # refresh has failed. Since Postgres raises an error when an unpopulated view is refreshed concurrently, this
61
62
  # allows the system to populated such views if needed
62
63
  private def attempt_non_concurrent_refresh?(ex, concurrently)
63
- if ex.original_exception.instance_of?(PG::FeatureNotSupported)
64
+ original_exception = ex.original_exception
65
+ should_retry_non_concurrently = original_exception.instance_of?(PG::FeatureNotSupported) ||
66
+ original_exception.instance_of?(PG::ObjectNotInPrerequisiteState)
67
+
68
+ if should_retry_non_concurrently
64
69
  concurrently
65
70
  else
66
71
  raise ex
data/lib/viewy/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Viewy
2
- VERSION = '0.1.2'
2
+ VERSION = '0.2.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: viewy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Emerson Huitt
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-16 00:00:00.000000000 Z
11
+ date: 2016-05-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails