Skip to content

Commit

Permalink
Bump version to 2.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
l7ssha committed Jan 3, 2022
1 parent f4f4080 commit 019c53c
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 6 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 2.6.0

- Add new packages to docs index
- Add local docs update time to info command

## 2.5.0

- Rewrite of docs module
Expand Down
5 changes: 3 additions & 2 deletions lib/src/commands/info_common.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import "dart:math" show Random;
import "package:nyxx/nyxx.dart";
import 'package:nyxx_interactions/nyxx_interactions.dart';
import "package:running_on_dart/src/internal/utils.dart" show dartVersion, getMemoryUsageString;
import "package:running_on_dart/src/modules/docs.dart" show fetchLastDocUpdate;
import "package:running_on_dart/src/modules/docs.dart" show fetchLastDocUpdate, lastDocCacheUpdate;
import "package:time_ago_provider/time_ago_provider.dart" show formatFull;

Future<ComponentMessageBuilder> infoGenericCommand(INyxxWebsocket client, [int shardId = 0]) async {
Expand All @@ -30,7 +30,8 @@ Future<ComponentMessageBuilder> infoGenericCommand(INyxxWebsocket client, [int s
inline: true)
..addField(name: "Memory usage (current/RSS)", content: getMemoryUsageString(), inline: true)
..addField(name: "Uptime", content: formatFull(client.startTime))
..addField(name: "Last doc update", content: formatFull(await fetchLastDocUpdate()));
..addField(name: "Last doc update", content: formatFull(await fetchLastDocUpdate()))
..addField(name: "Last local docs index update", content: formatFull(lastDocCacheUpdate));

return ComponentMessageBuilder()
..embeds = [embed]
Expand Down
7 changes: 6 additions & 1 deletion lib/src/modules/docs.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,17 @@ const docUrls = [
"https://pub.dev/documentation/nyxx_commander/latest/index.json",
"https://pub.dev/documentation/nyxx_lavalink/latest/index.json",
"https://pub.dev/documentation/nyxx_extensions/latest/index.json",
"https://pub.dev/documentation/nyxx_commands/latest/index.json",
"https://pub.dev/documentation/nyxx_sharding/latest/index.json",
];

late DateTime lastDocCacheUpdate;
late DateTime lastDocUpdate;

DateTime lastDocUpdateTimer = DateTime(2005);
Uri get docUpdatePath => Uri.parse("https://api.github.com/repos/nyxx-discord/nyxx/actions/runs?status=success&per_page=1&page=1");

late final logger = Logger("ROD - docs");
late final logger = Logger("ROD - Docs");

void setupDocsUpdateJob() {
logger.info("Starting docs cache updater job");
Expand All @@ -43,6 +47,7 @@ Future<void> updateDocsCache() async {
await File("docs_cache.json").writeAsString(jsonEncode(output), mode: FileMode.write);

logger.info("Update of docs cache successful");
lastDocCacheUpdate = DateTime.now();
}

Stream<SearchResult> _whereInDocs(int count, bool Function(dynamic) predicate) async* {
Expand Down
4 changes: 2 additions & 2 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ packages:
name: nyxx
url: "https://pub.dartlang.org"
source: hosted
version: "3.1.1"
version: "3.2.1"
nyxx_commander:
dependency: "direct main"
description:
Expand Down Expand Up @@ -226,7 +226,7 @@ packages:
name: time_ago_provider
url: "https://pub.dartlang.org"
source: hosted
version: "4.1.1"
version: "4.1.2"
typed_data:
dependency: transitive
description:
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: running_on_dart
version: 2.5.0
version: 2.6.0
description: Discord Bot for nyxx development
homepage: https://github.com/nyxx-discord/running_on_dart
repository: https://github.com/nyxx-discord/running_on_dart
Expand Down

0 comments on commit 019c53c

Please sign in to comment.