misskey/packages/backend/src/services
Johann150 e27c6abaea
refactor: temporary files (#8713)
* simplify temporary files for thumbnails

Because only a single file will be written to the directory, creating a
separate directory seems unnecessary. If only a temporary file is created,
the code from `createTemp` can be reused here as well.

* refactor: deduplicate code for temporary files/directories

To follow the DRY principle, the same code should not be duplicated
across different files. Instead an already existing function is used.

Because temporary directories are also create in multiple locations,
a function for this is also newly added to reduce duplication.

* fix: clean up identicon temp files

The temporary files for identicons are not reused and can be deleted
after they are fully read. This condition is met when the stream is closed
and so the file can be cleaned up using the events API of the stream.

* fix: ensure cleanup is called when download fails

* fix: ensure cleanup is called in error conditions

This covers import/export queue jobs and is mostly just wrapping all
code in a try...finally statement where the finally runs the cleanup.

* fix: use correct type instead of `any`
2022-05-25 16:50:22 +09:00
..
blocking fix: Promises -> Promise (#8545) 2022-04-25 15:14:13 +09:00
chart refactor: migrate to typeorm 3.0 (#8443) 2022-03-26 15:34:00 +09:00
drive refactor: temporary files (#8713) 2022-05-25 16:50:22 +09:00
following fix: Promises -> Promise (#8545) 2022-04-25 15:14:13 +09:00
i refactor: migrate to typeorm 3.0 (#8443) 2022-03-26 15:34:00 +09:00
messages feat: Improve Push Notification (#7667) 2022-04-30 21:52:07 +09:00
note fix: wrong type for isVisibleForMe 2022-05-24 10:12:42 +02:00
user-list refactor: Use ESM (#8358) 2022-02-27 11:07:39 +09:00
add-note-to-antenna.ts refactor: migrate to typeorm 3.0 (#8443) 2022-03-26 15:34:00 +09:00
create-notification.ts feat: Improve Push Notification (#7667) 2022-04-30 21:52:07 +09:00
create-system-user.ts refactor: migrate to typeorm 3.0 (#8443) 2022-03-26 15:34:00 +09:00
fetch-instance-metadata.ts enhance: uniform theme color (#8702) 2022-05-19 09:54:45 +02:00
insert-moderation-log.ts refactor: Use ESM (#8358) 2022-02-27 11:07:39 +09:00
instance-actor.ts refactor: migrate to typeorm 3.0 (#8443) 2022-03-26 15:34:00 +09:00
logger.ts refactor: Use ESM (#8358) 2022-02-27 11:07:39 +09:00
push-notification.ts feat: Improve Push Notification (#7667) 2022-04-30 21:52:07 +09:00
register-or-fetch-instance-doc.ts refactor: migrate to typeorm 3.0 (#8443) 2022-03-26 15:34:00 +09:00
relay.ts refactor: use structuredClone for deep clone 2022-04-23 12:38:02 +09:00
send-email-notification.ts refactor: migrate to typeorm 3.0 (#8443) 2022-03-26 15:34:00 +09:00
send-email.ts refactor: Use ESM (#8358) 2022-02-27 11:07:39 +09:00
stream.ts refactor: Use ESM (#8358) 2022-02-27 11:07:39 +09:00
suspend-user.ts .js 2022-03-25 16:35:24 +09:00
unsuspend-user.ts .js 2022-03-25 16:35:24 +09:00
update-hashtag.ts refactor: migrate to typeorm 3.0 (#8443) 2022-03-26 15:34:00 +09:00
user-cache.ts refactor: migrate to typeorm 3.0 (#8443) 2022-03-26 15:34:00 +09:00
validate-email-for-account.ts refactor: migrate to typeorm 3.0 (#8443) 2022-03-26 15:34:00 +09:00