refactor: remove config namespaces

This commit is contained in:
NGPixel
2018-05-28 14:46:55 -04:00
parent b1499d1d64
commit 416755f17a
27 changed files with 556 additions and 283 deletions

View File

@@ -7,14 +7,15 @@ const { createApolloFetch } = require('apollo-fetch')
WIKI.redis = require('../core/redis').init()
WIKI.db = require('../core/db').init()
const apollo = createApolloFetch({
uri: 'https://graph.requarks.io'
})
module.exports = async (job) => {
WIKI.logger.info(`Fetching locale ${job.data.locale} from Graph endpoint...`)
try {
await WIKI.configSvc.loadFromDb()
const apollo = createApolloFetch({
uri: WIKI.config.graphEndpoint
})
const respStrings = await apollo({
query: `query ($code: String!) {
localization {

View File

@@ -7,15 +7,14 @@ const { createApolloFetch } = require('apollo-fetch')
WIKI.redis = require('../core/redis').init()
WIKI.db = require('../core/db').init()
const apollo = createApolloFetch({
uri: 'https://graph.requarks.io'
})
module.exports = async (job) => {
WIKI.logger.info('Syncing locales with Graph endpoint...')
try {
await WIKI.configSvc.loadFromDb(['site'])
await WIKI.configSvc.loadFromDb()
const apollo = createApolloFetch({
uri: WIKI.config.graphEndpoint
})
// -> Fetch locales list