iceshrimp-legacy/packages/backend/src
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
..
@types chore(lint): fix type definitions for jsrsasign (#8528) 2022-04-23 12:45:36 +09:00
boot enhance: Perform port diagnosis at startup only when Listen fails (#8698) 2022-05-19 11:49:07 +09:00
config refactor: use Vite to build instead of webpack (#8575) 2022-05-01 22:51:07 +09:00
daemons refactor: fix type 2022-04-17 14:42:13 +09:00
db refactor 2022-05-21 22:07:11 +09:00
mfm refactor: Use ESM (#8358) 2022-02-27 11:07:39 +09:00
misc refactor: temporary files (#8713) 2022-05-25 16:50:22 +09:00
models chore: synchronize code and database schema (#8577) 2022-05-05 22:45:22 +09:00
prelude refactor: Use ESM (#8358) 2022-02-27 11:07:39 +09:00
queue refactor: temporary files (#8713) 2022-05-25 16:50:22 +09:00
remote fix: wrong type for isVisibleForMe 2022-05-24 10:12:42 +02:00
server refactor: temporary files (#8713) 2022-05-25 16:50:22 +09:00
services refactor: temporary files (#8713) 2022-05-25 16:50:22 +09:00
const.ts remove max note text length setting 2022-02-20 16:07:43 +09:00
env.ts refactoring 2021-11-12 02:02:25 +09:00
global.d.ts refactoring 2021-11-12 02:02:25 +09:00
index.ts refactor: Use ESM (#8358) 2022-02-27 11:07:39 +09:00
types.ts feat: アンケート終了通知 2022-03-06 16:06:27 +09:00