Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Metabase
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Engineering Digital Service
Metabase
Commits
0c840ded
Unverified
Commit
0c840ded
authored
7 years ago
by
Cam Saul
Browse files
Options
Downloads
Patches
Plain Diff
Fix plugins being able to introduce new Metabase namespaces (credit: @alexuf)
parent
b6819782
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/metabase/util.clj
+9
-9
9 additions, 9 deletions
src/metabase/util.clj
with
9 additions
and
9 deletions
src/metabase/util.clj
+
9
−
9
View file @
0c840ded
...
...
@@ -768,15 +768,15 @@
(
def
metabase-namespace-symbols
"Delay to a vector of symbols of all Metabase namespaces, excluding test namespaces.
This is intended for use by various routines that load related namespaces, such as task and events initialization.
Using `ns-find/find-namespaces` is fairly slow, and can take as much as half a second to iterate over the thousand
or so
namespaces that are part of the Metabase project; use this instead for a massive performance increase."
;;
Actually we can go ahead and start do
in
g
th
is in the background once the app launches while other stuff is loading, so use
a future
here
;;
This would be faster when runn
in
g
the
*JAR* if we just did it at compile-time and made it ^:const, but that would inhibit the "plugin system"
;;
from loading "plugin" namespaces at launch if they're on the classpath
(
future
(
vec
(
for
[
ns-symb
(
ns-find/find-namespaces
(
classpath/system-classpath
))
:when
(
and
(
.startsWith
(
name
ns-symb
)
"metabase."
)
(
not
(
.contains
(
name
ns-symb
)
"test"
)))]
ns-symb
))))
Using `ns-find/find-namespaces` is fairly slow, and can take as much as half a second to iterate over the thousand
or so
namespaces that are part of the Metabase project; use this instead for a massive performance increase."
;;
We want to give JARs
in th
e ./plugins directory a chance to load. At one point we have this as
a future
so it
;;
start looking for things
in the
background while other stuff is happening but that meant plugins couldn't
;;
introduce new Metabase namespaces such as drivers.
(
delay
(
vec
(
for
[
ns-symb
(
ns-find/find-namespaces
(
classpath/system-classpath
))
:when
(
and
(
.startsWith
(
name
ns-symb
)
"metabase."
)
(
not
(
.contains
(
name
ns-symb
)
"test"
)))]
ns-symb
))))
(
def
^
:const
^
java.util.regex.Pattern
uuid-regex
"A regular expression for matching canonical string representations of UUIDs."
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment