- secondcommit: delete unnecessary test files

This commit is contained in:
Arno Kaimbacher 2022-11-07 14:32:01 +01:00
parent 407717d4b5
commit 44688ac806
4 changed files with 18 additions and 87 deletions

2
app.js
View File

@ -1,2 +0,0 @@
var msg = "Hello World";
console.log(msg);

View File

@ -1,80 +0,0 @@
import Sequelize from "sequelize";
import * as dotenv from "dotenv"; // see https://github.com/motdotla/dotenv#how-do-i-use-dotenv-with-import
dotenv.config();
// module.exports = {
// HOST: "localhost",
// USER: "tethys_admin",
// PASSWORD: "tethys_admin007",
// DB: "tethys",
// dialect: "postgres",
// pool: {
// max: 5,
// min: 0,
// acquire: 30000,
// idle: 10000
// }
// };
// const pg = require('pg');
// pg.types.setTypeParser(1114, (str) => new Date((str.split(' ').join('T'))+'Z'));
const dbSchema = process.env.DB_SCHEMA;
const dbName = process.env.DB_NAME;
const dbUser = process.env.DB_USER;
const dbPassword = process.env.DB_PASSWORD;
const dbHost = process.env.DB_HOST;
// const dbDriver = process.env.DB_DRIVER; // as Dialect
const sequelizeConnection = new Sequelize(
dbName,
dbUser,
dbPassword,
{
schema: dbSchema,
host: dbHost || "localhost",
port: process.env.DB_PORT || 5432,
dialect: "postgres",
dialectOptions: {
ssl: process.env.DB_SSL == "true",
},
pool: {
max: 10,
min: 0,
acquire: 30000,
idle: 10000,
},
logging: false,
dialectOptions: {
useUTC: false, //for reading from database
dateStrings: true,
typeCast: true
},
timezone: '+02:00' //for writing to database
// host: "localhost",
// dialect: 'postgres',
// logging: false
}
);
sequelizeConnection
.authenticate()
.then(() => {
console.log("Connection has been established successfully.");
})
.catch((err) => {
console.error("Unable to connect to the database:", err);
});
export default sequelizeConnection;
// export default sequelizeConnection;
// // relations
// Dataset.hasMany(Title, {
// as: "titles",
// foreignKey: "document_id"
// });
// Title.belongsTo(Dataset, {
// foreignKey: "document_id",
// as: "dataset",
// });

View File

@ -93,3 +93,16 @@ npm install --save redis
npm i sprintf-js --save
npm i --save-dev @types/sprintf-js
======================================== git =============================================================
git config --global user.name
git config --global user.email
git remote add origin https://gitea.geologie.ac.at/geolba/tethys.api.git
git push -o repo.private=false --set-upstream origin master

View File

@ -335,10 +335,10 @@ export class OaiController {
*/
protected async handleListIdentifiers(oaiRequest: OaiParameter) {
// if ("resumptionToken" in oaiRequest) {
if (!this.tokenWorker) {
this.tokenWorker = new TokenWorker(86400);
}
!this.tokenWorker.Connected && (await this.tokenWorker.connect());
if (!this.tokenWorker) {
this.tokenWorker = new TokenWorker(86400);
}
!this.tokenWorker.Connected && (await this.tokenWorker.connect());
//$maxIdentifier = 5; //$this->_configuration->getMaxListIdentifiers();
const maxIdentifier = this.configuration.maxListIds; //->getMaxListIdentifiers();