debug
This commit is contained in:
parent
c81dfdf5c9
commit
94ac7cfcb6
|
@ -37,6 +37,7 @@ Future<void> _importPosts(fileUri) async {
|
|||
for (final line in lines) {
|
||||
if (line.isEmpty && post != '') {
|
||||
posts.add(post);
|
||||
print('Added post: $post');
|
||||
} else {
|
||||
post += '$line\n';
|
||||
}
|
||||
|
@ -44,6 +45,7 @@ Future<void> _importPosts(fileUri) async {
|
|||
|
||||
if (post != '') {
|
||||
posts.add(post);
|
||||
print('Added post: $post');
|
||||
}
|
||||
|
||||
// Read posts.json and add posts to it
|
||||
|
@ -96,14 +98,14 @@ void main(List<String> args) async {
|
|||
await _importPosts('/data/posts.txt');
|
||||
|
||||
// Post a random post
|
||||
await _postRandomPost();
|
||||
// await _postRandomPost();
|
||||
|
||||
// Post a random post at random time
|
||||
// Random time is between 1 and 8 hours
|
||||
// Random time is choosen after every post
|
||||
while (true) {
|
||||
await Future.delayed(Duration(hours: Random().nextInt(8) + 1));
|
||||
await _postRandomPost();
|
||||
}
|
||||
// while (true) {
|
||||
// await Future.delayed(Duration(hours: Random().nextInt(8) + 1));
|
||||
// await _postRandomPost();
|
||||
// }
|
||||
|
||||
}
|
||||
|
|
|
@ -10,8 +10,6 @@ environment:
|
|||
dependencies:
|
||||
args: ^2.0.0
|
||||
dio: ^4.0.6
|
||||
shelf: ^1.1.0
|
||||
shelf_router: ^1.0.0
|
||||
|
||||
dev_dependencies:
|
||||
http: ^0.13.0
|
||||
|
|
Loading…
Reference in a new issue