Browse Source

storage-node: Fix linter warnings.

Shamil Gadelshin 4 years ago
parent
commit
9d6b47c4e3

+ 2 - 2
storage-node/packages/colossus/bin/cli.js

@@ -242,8 +242,8 @@ async function start_colossus({ api, publicUrl, port, flags }) {
 	// TODO: check valid url, and valid port number
 	const store = get_storage(api)
 	banner()
-	const { start_syncing } = require('../lib/sync')
-	start_syncing(api, { syncPeriod: SYNC_PERIOD_MS }, store)
+	const { startSyncing } = require('../lib/sync')
+	startSyncing(api, { syncPeriod: SYNC_PERIOD_MS }, store)
 	announce_public_url(api, publicUrl)
 	return start_all_services({ store, api, port, flags }) // dont pass all flags only required values
 }

+ 8 - 8
storage-node/packages/colossus/lib/sync.js

@@ -20,7 +20,7 @@
 
 const debug = require('debug')('joystream:sync')
 
-async function sync_callback(api, storage) {
+async function syncCallback(api, storage) {
 	// The first step is to gather all data objects from chain.
 	// TODO: in future, limit to a configured tranche
 	// FIXME this isn't actually on chain yet, so we'll fake it.
@@ -89,22 +89,22 @@ async function sync_callback(api, storage) {
 	return Promise.all(allChecks)
 }
 
-async function sync_periodic(api, flags, storage) {
+async function syncPeriodic(api, flags, storage) {
 	try {
 		debug('Starting sync run...')
-		await sync_callback(api, storage)
+		await syncCallback(api, storage)
 		debug('sync run complete')
 	} catch (err) {
-		debug(`Error in sync_periodic ${err.stack}`)
+		debug(`Error in syncPeriodic ${err.stack}`)
 	}
 	// always try again
-	setTimeout(sync_periodic, flags.syncPeriod, api, flags, storage)
+	setTimeout(syncPeriodic, flags.syncPeriod, api, flags, storage)
 }
 
-function start_syncing(api, flags, storage) {
-	sync_periodic(api, flags, storage)
+function startSyncing(api, flags, storage) {
+	syncPeriodic(api, flags, storage)
 }
 
 module.exports = {
-	start_syncing,
+	startSyncing,
 }

+ 2 - 2
storage-node/packages/storage/filter.js

@@ -91,7 +91,7 @@ function mimeMatchesAny(accept, reject, provided) {
  * @param {string} mimeType - expected MIME type
  * @return {object} HTTP status code and error message.
  **/
-function filter_func(config, headers, mimeType) {
+function filterFunc(config, headers, mimeType) {
 	const filter = configDefaults(config)
 
 	// Enforce maximum file upload size
@@ -125,4 +125,4 @@ function filter_func(config, headers, mimeType) {
 	}
 }
 
-module.exports = filter_func
+module.exports = filterFunc