mirror of
https://github.com/discourse/discourse.git
synced 2025-08-21 19:11:18 +08:00
FEATURE: automatically update site to latest version of assets
if a user neglects to move around the site it will prompt to do so 2 hours in
This commit is contained in:
parent
abe814412e
commit
a247389d4e
7 changed files with 35 additions and 16 deletions
|
@ -59,6 +59,20 @@ module Discourse
|
|||
@plugins
|
||||
end
|
||||
|
||||
def self.assets_digest
|
||||
@assets_digest ||= begin
|
||||
digest = Digest::MD5.hexdigest(ActionView::Base.assets_manifest.assets.values.sort.join)
|
||||
|
||||
channel = "/global/asset-version"
|
||||
message = MessageBus.last_message(channel)
|
||||
|
||||
unless message && message.data == digest
|
||||
MessageBus.publish channel, digest
|
||||
end
|
||||
digest
|
||||
end
|
||||
end
|
||||
|
||||
def self.authenticators
|
||||
# TODO: perhaps we don't need auth providers and authenticators maybe one object is enough
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue