add time taken to paste api and fixed text size on the creation page
All checks were successful
Deploy App / docker (ubuntu-latest, 2.44.0, 17, 3.8.5) (push) Successful in 1m3s
Publish Docker Image / docker (ubuntu-latest, 2.44.0, 17, 3.8.5) (push) Successful in 1m4s

This commit is contained in:
Lee 2024-06-01 21:55:58 +01:00
parent 0e585ed1cd
commit f046d9cc68
2 changed files with 5 additions and 3 deletions

@ -45,6 +45,7 @@ public class PasteService {
*/
public String createPaste(String content) {
int length = content.length();
long before = System.currentTimeMillis();
log.info("Creating a new paste. (characters: {})", length);
// Check if the content is too large.
@ -59,7 +60,7 @@ public class PasteService {
System.currentTimeMillis(),
content
));
log.info("Created a new paste with the id '{}'", paste.getId());
log.info("Created a new paste with the id '{}' (took: {}ms)", paste.getId(), System.currentTimeMillis() - before);
return paste.getId();
}
@ -71,6 +72,7 @@ public class PasteService {
*/
public Paste getPaste(String id) {
log.info("Getting paste with the id '{}'", id);
long before = System.currentTimeMillis();
Optional<Paste> paste = pasteRepository.findById(id);
// The paste does not exist.
@ -78,7 +80,7 @@ public class PasteService {
log.info("Paste with the id '{}' not found", id);
throw new ResourceNotFoundException("Paste '%s' not found".formatted(id));
}
log.info("Got paste with the id '{}'", id);
log.info("Got paste with the id '{}' (took: {}ms)", id, System.currentTimeMillis() - before);
return paste.get();
}
}

@ -12,7 +12,7 @@
</head>
<body class="bg-black text-white">
<div class="p-3 h-screen w-screen relative">
<div class="flex gap-2 h-full w-full text-xs">
<div class="flex gap-2 h-full w-full text-sm">
<p class="hidden md:block">&gt;</p>
<textarea
id="paste-input"