Skip to content

Commit

Permalink
rename, amend paths
Browse files Browse the repository at this point in the history
  • Loading branch information
xsalonx committed Sep 25, 2023
1 parent c05afe4 commit bf13623
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions app/lib/alimonitor-services/BookkeepingService.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const { databaseManager: {
},
sequelize,
} } = require('../database/DatabaseManager.js');
const { upsertOrCreatePeriod } = require('../services/periods/findOrUpsertOrCreatePeriod.js');
const { createOrForceUpdate } = require('../services/periods/findOrUpdateOrCreatePeriod.js');

/**
* BookkeepingService used to synchronize runs
Expand Down Expand Up @@ -143,7 +143,7 @@ class BookkeepingService extends AbstractServiceSynchronizer {
);
};

const pipeline = async () => await upsertOrCreatePeriod(period)
const pipeline = async () => await createOrForceUpdate(period)
.then(upsertRun)
.then(bulkCreateRunDetectors);

Expand Down
2 changes: 1 addition & 1 deletion app/lib/alimonitor-services/MonalisaService.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const { databaseManager: {
},
sequelize,
} } = require('../database/DatabaseManager.js');
const { findOrCreatePeriod } = require('../services/periods/findOrUpsertOrCreatePeriod.js');
const { findOrCreatePeriod } = require('../services/periods/findOrUpdateOrCreatePeriod.js');

class MonalisaService extends AbstractServiceSynchronizer {
constructor() {
Expand Down
2 changes: 1 addition & 1 deletion app/lib/alimonitor-services/MonalisaServiceDetails.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
const AbstractServiceSynchronizer = require('./AbstractServiceSynchronizer.js');
const Utils = require('../utils');
const { ServicesEndpointsFormatter, ServicesDataCommons: { PERIOD_NAME_REGEX } } = require('./helpers');
const { findOrCreatePeriod } = require('../services/periods/findOrUpsertOrCreatePeriod.js');
const { findOrCreatePeriod } = require('../services/periods/findOrUpdateOrCreatePeriod.js');

const { databaseManager: {
repositories: {
Expand Down
2 changes: 1 addition & 1 deletion app/lib/alimonitor-services/MonalisaServiceMC.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const { databaseManager: {
},
sequelize,
} } = require('../database/DatabaseManager.js');
const { findOrCreatePeriod } = require('../services/periods/findOrUpsertOrCreatePeriod.js');
const { findOrCreatePeriod } = require('../services/periods/findOrUpdateOrCreatePeriod.js');

class MonalisaServiceMC extends AbstractServiceSynchronizer {
constructor() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ const findOrCreatePeriod = async (period) =>
* @param {Period} period as {name, year, beamType}
* @returns {[SequelizePeriod, boolean]} result of sequelize.Model.findOrCreate
*/
const upsertOrCreatePeriod = async (period) => {
const createOrForceUpdate = async (period) => {
const { year } = period;
return await findOrCreatePeriod(period)
.then(async ([dbPeriod, _]) => [dbPeriod, await PeriodRepository.updateOne(dbPeriod, { year })])
Expand All @@ -99,5 +99,5 @@ const upsertOrCreatePeriod = async (period) => {

module.exports = {
findOrCreatePeriod,
upsertOrCreatePeriod,
createOrForceUpdate,
};

0 comments on commit bf13623

Please sign in to comment.