Commit 98057885 authored by Jonne Haß's avatar Jonne Haß

use uuids for guid generation

parent 07aec2a6
# Head
## Change in guid generation
This version will break federation to pods running on versions prior 0.1.1.0.
Read more in [#4249](https://github.com/diaspora/diaspora/pull/4249) and [#4883](https://github.com/diaspora/diaspora/pull/4883)
## Refactor
* Drop number of followers from tags page [#4717](https://github.com/diaspora/diaspora/issues/4717)
* Remove some unused beta code [#4738](https://github.com/diaspora/diaspora/issues/4738)
......
......@@ -50,6 +50,9 @@ gem 'fog', '1.19.0'
gem 'mini_magick', '3.7.0'
gem 'remotipart', '1.2.1'
# GUID generation
gem 'uuid', '2.3.7'
# Localization
gem 'http_accept_language', '1.0.2'
......
......@@ -223,6 +223,8 @@ GEM
rb-fsevent (>= 0.9.3)
rb-inotify (>= 0.9)
lumberjack (1.0.4)
macaddr (1.6.1)
systemu (~> 2.5.0)
mail (2.5.4)
mime-types (~> 1.16)
treetop (~> 1.4.8)
......@@ -411,6 +413,7 @@ GEM
activemodel (~> 3.0)
railties (~> 3.0)
subexec (0.2.3)
systemu (2.5.2)
test_after_commit (0.2.2)
thor (0.18.1)
thread_safe (0.1.3)
......@@ -435,8 +438,10 @@ GEM
kgio (~> 2.6)
rack
raindrops (~> 0.7)
warden (1.2.3)
uuid (2.3.7)
macaddr (~> 1.0)
rack (>= 1.0)
warden (1.2.3)
webmock (1.16.1)
addressable (>= 2.2.7)
crack (>= 0.3.2)
......@@ -532,6 +537,7 @@ DEPENDENCIES
typhoeus (= 0.6.7)
uglifier (= 2.1.2)
unicorn (= 4.8.0)
uuid (= 2.3.7)
webmock (= 1.16.1)
will_paginate (= 3.0.5)
zip-zip
......@@ -44,6 +44,9 @@ Sidekiq.configure_server do |config|
ENV['DATABASE_URL'] = "#{database_url}?pool=#{AppConfig.environment.sidekiq.concurrency.get}"
ActiveRecord::Base.establish_connection
end
# Make sure each Sidekiq process has its own sequence of UUIDs
UUID.generator.next_sequence
end
Sidekiq.configure_client do |config|
......
......@@ -48,4 +48,7 @@ end
after_fork do |server, worker|
# If using preload_app, enable this line
ActiveRecord::Base.establish_connection
# We don't generate uuids in the frontend, but let's be on the safe side
UUID.generator.next_sequence
end
......@@ -13,6 +13,6 @@ module Diaspora::Guid
# @return [String] The model's guid.
def set_guid
self.guid = SecureRandom.hex(8) if self.guid.blank?
self.guid = UUID.generate :compact if self.guid.blank?
end
end
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment