Skip to content
This repository was archived by the owner on Oct 5, 2021. It is now read-only.

fix issue with refresh_schema thread #102

Merged
merged 2 commits into from
Jan 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ coverage
tmp
log
config/attribute-map.yml
.idea/
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ Change Log

All notable changes to this project will be documented in this file using [Semantic Versioning](http://semver.org/).

## [0.4.8] - 2020-01-20
### Fixed
- [Fix issue with thread refresh_schema](https://github.com/lumoslabs/aleph/issues/103)

## [0.4.7] - 2020-01-17
### Fixed
- Fix issue with schema cache
Expand Down
4 changes: 2 additions & 2 deletions aleph.gemspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Gem::Specification.new do |s|
s.name = 'aleph_analytics'
s.version = '0.4.7'
s.date = '2020-01-17'
s.version = '0.4.8'
s.date = '2020-01-20'
s.summary = 'Redshift/Snowflake analytics platform'
s.description = 'The best way to develop and share queries/investigations/results within an analytics team'
s.authors = ['Andrew Xue', 'Rob Froetscher', 'Joyce Lau']
Expand Down
3 changes: 2 additions & 1 deletion lib/schemas/descriptor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ def initialize(role)

Rails.logger.info("Start schema refresher thread for #{@role}")
@refresher_thread = Thread.new{ schema_refresher }
@refresher_thread.abort_on_exception = true
end

def schemas
Expand Down Expand Up @@ -61,7 +62,7 @@ def retrieve
def schema_refresher
loop do
refresh_schema
sleep(SCHEMA_REFRESH_INTERVAL)
sleep(SCHEMA_REFRESH_INTERVAL.to_i)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hm, this shouldn't be needed, ruby automatically converts 1.hour to 3600, but i guess there is a reason to this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when value gets from yml, than it is parsed as string
if it gets default value, parsing to int will work too

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, strange that i won't get parsed as an integer, but this should than fix it!

end
end

Expand Down