Check config on load (#4170)
Co-authored-by: syuilo <syuilotan@yahoo.co.jp>
This commit is contained in:
parent
41ba06a5e6
commit
96bc17aa10
19 changed files with 195 additions and 125 deletions
|
|
@ -50,8 +50,9 @@ async function save(path: string, name: string, type: string, hash: string, size
|
|||
if (type === 'image/webp') ext = '.webp';
|
||||
}
|
||||
|
||||
const baseUrl = config.drive.baseUrl
|
||||
|| `${ config.drive.config.useSSL ? 'https' : 'http' }://${ config.drive.config.endPoint }${ config.drive.config.port ? `:${config.drive.config.port}` : '' }/${ config.drive.bucket }`;
|
||||
const baseUrl = config.drive.baseUrl.getOrElse(
|
||||
`${ config.drive.config.useSSL ? 'https' : 'http' }://${ config.drive.config.endPoint }${ config.drive.config.port ? `:${config.drive.config.port}` : '' }/${ config.drive.bucket }`
|
||||
);
|
||||
|
||||
// for original
|
||||
const key = `${config.drive.prefix}/${uuid.v4()}${ext}`;
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ export default async (
|
|||
|
||||
const req = request({
|
||||
url: requestUrl,
|
||||
proxy: config.proxy,
|
||||
proxy: config.proxy.getOrElse(null),
|
||||
timeout: 10 * 1000,
|
||||
headers: {
|
||||
'User-Agent': config.user_agent
|
||||
|
|
|
|||
|
|
@ -500,7 +500,7 @@ async function insertNote(user: IUser, data: Option, tags: string[], emojis: str
|
|||
}
|
||||
|
||||
function index(note: INote) {
|
||||
if (note.text == null || config.elasticsearch == null) return;
|
||||
if (note.text == null || !config.elasticsearch.isJust()) return;
|
||||
|
||||
es.index({
|
||||
index: 'misskey',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue