Skip to content

Commit

Permalink
Delete logs when measurement is uploaded (#497)
Browse files Browse the repository at this point in the history
  • Loading branch information
aanorbel authored Feb 13, 2023
1 parent 8514750 commit b71de5a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 0 additions & 2 deletions ooniprobe/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,6 @@ - (void)applicationDidBecomeActive:(UIApplication *)application {
//Called in case the user disable notifications from iOS panel
if (![[UIApplication sharedApplication] isRegisteredForRemoteNotifications])
[[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"notifications_enabled"];
if ([TestUtility canCallDeleteJson])
[TestUtility deleteUploadedJsons];
[TestUtility deleteOldLogs];
[[Harpy sharedInstance] checkVersionDaily];
}
Expand Down
3 changes: 3 additions & 0 deletions ooniprobe/Test/Test/AbstractTest.m
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,9 @@ -(void)runTest{
if (measurement != nil){
measurement.is_done = true;
[measurement save];
if (measurement.is_uploaded) {
[TestUtility removeFile:[measurement getReportFile]];
}
}
}
else if ([event.key isEqualToString:@"status.end"]) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ -(void)uploadMeasurements:(NSArray *)notUploaded{
});
if (![self uploadMeasurement:currentMeasurement session:session]){
errors++;
} else {
[TestUtility removeFile:[currentMeasurement getReportFile]];
}
progress += measurementValue;
i++;
Expand Down

0 comments on commit b71de5a

Please sign in to comment.