Skip to content

Commit

Permalink
Add note to /spark profiler open about expiry time
Browse files Browse the repository at this point in the history
  • Loading branch information
lucko committed Jun 9, 2024
1 parent 3ac58fd commit c3aa0cd
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,20 @@ private void handleOpen(SparkPlatform platform, BytesocksClient bytesocksClient,
.build()
);

String cmd = "/" + platform.getPlugin().getCommandName() + " profiler stop";
resp.broadcastPrefixed(text()
.append(text("(Note: this link is temporary and will expire after a short period of time. " +
"If you need a link to share with other people (e.g. in a bug report), please use ", GRAY))
.append(text()
.content(cmd)
.color(WHITE)
.clickEvent(ClickEvent.runCommand(cmd))
.build()
)
.append(text(" instead.)", GRAY))
.build()
);

platform.getActivityLog().addToLog(Activity.urlActivity(resp.sender(), System.currentTimeMillis(), "Profiler (live)", url));
} catch (Exception e) {
resp.replyPrefixed(text("An error occurred whilst opening the live profiler.", RED));
Expand Down

0 comments on commit c3aa0cd

Please sign in to comment.