summaryrefslogtreecommitdiffstats
path: root/mattermost.go
diff options
context:
space:
mode:
authorCorey Hulen <corey@hulen.com>2016-02-04 13:01:14 -0800
committerCorey Hulen <corey@hulen.com>2016-02-04 13:01:14 -0800
commitaf6ade338002a215ff7c7771f7fe6bbbb06f0cd7 (patch)
treea8e696aaaf8fd4e483d52f356e848aafcf2a6c25 /mattermost.go
parentec51c31c325b3dc648a261f0e8634b6d70d7ba73 (diff)
parente45282deaa1d78d7ff3a125e9fd11e3fdc120b07 (diff)
downloadchat-af6ade338002a215ff7c7771f7fe6bbbb06f0cd7.tar.gz
chat-af6ade338002a215ff7c7771f7fe6bbbb06f0cd7.tar.bz2
chat-af6ade338002a215ff7c7771f7fe6bbbb06f0cd7.zip
Merge pull request #2073 from mattermost/ee-updates
Some general updates to EE
Diffstat (limited to 'mattermost.go')
-rw-r--r--mattermost.go22
1 files changed, 21 insertions, 1 deletions
diff --git a/mattermost.go b/mattermost.go
index 43fa06601..5a18e2f40 100644
--- a/mattermost.go
+++ b/mattermost.go
@@ -69,7 +69,7 @@ func main() {
web.InitWeb()
if model.BuildEnterpriseReady == "true" {
- utils.LoadLicense()
+ loadLicense()
}
if flagRunCmds {
@@ -95,6 +95,26 @@ func main() {
}
}
+func loadLicense() {
+ licenseId := ""
+ if result := <-api.Srv.Store.System().Get(); result.Err == nil {
+ props := result.Data.(model.StringMap)
+ licenseId = props[model.SYSTEM_ACTIVE_LICENSE_ID]
+ }
+
+ if len(licenseId) != 26 {
+ l4g.Warn(utils.T("mattermost.load_license.find.warn"))
+ return
+ }
+
+ if result := <-api.Srv.Store.License().Get(licenseId); result.Err == nil {
+ record := result.Data.(*model.LicenseRecord)
+ utils.LoadLicense([]byte(record.Bytes))
+ } else {
+ l4g.Warn(utils.T("mattermost.load_license.find.warn"))
+ }
+}
+
func setDiagnosticId() {
if result := <-api.Srv.Store.System().Get(); result.Err == nil {
props := result.Data.(model.StringMap)