Skip to content

Commit

Permalink
Linting
Browse files Browse the repository at this point in the history
  • Loading branch information
Göran Sander committed Jan 30, 2024
1 parent 568aa2e commit bb7047a
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 22 deletions.
8 changes: 4 additions & 4 deletions src/globals.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class Settings {
}

// Get app version from package.json file
const filename = `./package.json`;
const filenamePackage = `./package.json`;
let a;
let b;
let c;
Expand All @@ -37,7 +37,7 @@ class Settings {
b = upath.dirname(a);

// Add path to package.json file
c = upath.join(b, filename);
c = upath.join(b, filenamePackage);
} else {
// Get path to JS file
a = fileURLToPath(import.meta.url);
Expand All @@ -46,7 +46,7 @@ class Settings {
b = upath.dirname(a);

// Add path to package.json file
c = upath.join(b, '..', filename);
c = upath.join(b, '..', filenamePackage);
}

const { version } = JSON.parse(readFileSync(c));
Expand Down Expand Up @@ -669,7 +669,7 @@ class Settings {
const enableInfluxdb = this.config.get('Butler.influxDb.enable');

// Ensure that InfluxDB has been created
if(this.influx === undefined) {
if (this.influx === undefined) {
this.logger.error('CONFIG: InfluxDB not initialized! Possible race condition during startup of Butler. Exiting.');
process.exit(1);
}
Expand Down
3 changes: 1 addition & 2 deletions src/routes/sense_app.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { readFileSync } from 'fs';
import { fileURLToPath } from 'url';
import upath from 'upath';


// Load global variables and functions
import globals from '../globals.js';

Expand All @@ -24,7 +23,7 @@ async function handlerPutAppReload(request, reply) {
// Are we running as a packaged app?
if (process.pkg) {
// Yes, we are running as a packaged app
// Get path to JS file const
// Get path to JS file const
a = process.pkg.defaultEntrypoint;

// Strip off the filename
Expand Down
4 changes: 2 additions & 2 deletions src/routes/sense_app_dump.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ async function handlerGetSenseAppDump(request, reply) {
// Are we running as a packaged app?
if (process.pkg) {
// Yes, we are running as a packaged app
// Get path to JS file const
// Get path to JS file const
a = process.pkg.defaultEntrypoint;

// Strip off the filename
Expand Down Expand Up @@ -72,7 +72,7 @@ async function handlerGetSenseAppDump(request, reply) {

// We can now interact with the global object, for example get the document list.
// Please refer to the Engine API documentation for available methods.
const app = await global.openDoc(request.params.appId, '', '', '', true);
const app = await global.openDoc(request.params.appId, '', '', '', true);
const data = await serializeApp(app);

reply.type('application/json; charset=utf-8').code(200).send(JSON.stringify(data));
Expand Down
28 changes: 14 additions & 14 deletions src/routes/sense_list_apps.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ async function handlerGetSenseListApps(request, reply) {
// Are we running as a packaged app?
if (process.pkg) {
// Yes, we are running as a packaged app
// Get path to JS file const
// Get path to JS file const
a = process.pkg.defaultEntrypoint;

// Strip off the filename
Expand Down Expand Up @@ -87,19 +87,19 @@ async function handlerGetSenseListApps(request, reply) {
globals.logger.error(`LISTAPPS: Error closing connection to Sense engine: ${JSON.stringify(err, null, 2)}`);
reply.send(httpErrors(500, 'Failed closing connection to Sense server'));
}
// .catch((error) => {
// globals.logger.error(
// `LISTAPPS: Error while opening session to Sense engine during app listing: ${JSON.stringify(error, null, 2)}`
// );

// try {
// session.close();
// } catch (err) {
// globals.logger.error(`LISTAPPS: Error closing connection to Sense engine: ${JSON.stringify(err, null, 2)}`);
// }

// reply.send(httpErrors(422, 'Failed to open session to Sense engine'));
// });
// .catch((error) => {
// globals.logger.error(
// `LISTAPPS: Error while opening session to Sense engine during app listing: ${JSON.stringify(error, null, 2)}`
// );

// try {
// session.close();
// } catch (err) {
// globals.logger.error(`LISTAPPS: Error closing connection to Sense engine: ${JSON.stringify(err, null, 2)}`);
// }

// reply.send(httpErrors(422, 'Failed to open session to Sense engine'));
// });
} catch (err) {
globals.logger.error(`LISTAPPS: getting list of Sense apps, error is: ${JSON.stringify(err, null, 2)}`);
reply.send(httpErrors(500, 'Failed getting list of Sense apps'));
Expand Down

0 comments on commit bb7047a

Please sign in to comment.