This commit is contained in:
syuilo
2021-12-09 23:58:30 +09:00
parent 0abe2dfee0
commit c69b72e199
573 changed files with 3318 additions and 3318 deletions

View File

@ -6,10 +6,10 @@ const index = {
analysis: {
analyzer: {
ngram: {
tokenizer: 'ngram'
}
}
}
tokenizer: 'ngram',
},
},
},
},
mappings: {
properties: {
@ -25,9 +25,9 @@ const index = {
userHost: {
type: 'keyword',
index: true,
}
}
}
},
},
},
};
// Init ElasticSearch connection
@ -35,9 +35,9 @@ const client = config.elasticsearch ? new elasticsearch.Client({
node: `${config.elasticsearch.ssl ? 'https://' : 'http://'}${config.elasticsearch.host}:${config.elasticsearch.port}`,
auth: (config.elasticsearch.user && config.elasticsearch.pass) ? {
username: config.elasticsearch.user,
password: config.elasticsearch.pass
password: config.elasticsearch.pass,
} : undefined,
pingTimeout: 30000
pingTimeout: 30000,
}) : null;
if (client) {
@ -47,7 +47,7 @@ if (client) {
if (!exist.body) {
client.indices.create({
index: config.elasticsearch.index || 'misskey_note',
body: index
body: index,
});
}
});

View File

@ -175,7 +175,7 @@ export const entities = [
Ad,
PasswordResetRequest,
UserPending,
...charts as any
...charts as any,
];
export function initDb(justBorrow = false, sync = false, forceRecreate = false) {
@ -205,12 +205,12 @@ export function initDb(justBorrow = false, sync = false, forceRecreate = false)
port: config.redis.port,
password: config.redis.pass,
prefix: `${config.redis.prefix}:query:`,
db: config.redis.db || 0
}
db: config.redis.db || 0,
},
} : false,
logging: log,
logger: log ? new MyCustomLogger() : undefined,
entities: entities
entities: entities,
});
}

View File

@ -8,7 +8,7 @@ export function createConnection() {
{
password: config.redis.pass,
prefix: config.redis.prefix,
db: config.redis.db || 0
db: config.redis.db || 0,
}
);
}