File tree 2 files changed +8
-9
lines changed
deepl-java/src/main/java/com/deepl/api
2 files changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
4
4
The format is based on [ Keep a Changelog] ( https://keepachangelog.com/en/1.0.0/ ) ,
5
5
and this project adheres to [ Semantic Versioning] ( https://semver.org/spec/v2.0.0.html ) .
6
6
7
+ ## Unreleased
8
+ ### Fixed
9
+ * Changed document translation to poll the server every 5 seconds. This should greatly reduce observed document translation processing time.
10
+
11
+
7
12
## [ 1.2.0] - 2023-03-22
8
13
### Added
9
14
* Script to check our source code for license headers and a step for them in the CI.
@@ -78,6 +83,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
78
83
Initial version.
79
84
80
85
86
+ [ Unreleased ] : https://github.com/DeepLcom/deepl-java/compare/v1.2.0...HEAD
81
87
[ 1.2.0 ] : https://github.com/DeepLcom/deepl-java/compare/v1.1.0...v1.2.0
82
88
[ 1.1.0 ] : https://github.com/DeepLcom/deepl-java/compare/v1.0.1...v1.1.0
83
89
[ 1.0.1 ] : https://github.com/DeepLcom/deepl-java/compare/v1.0.0...v1.0.1
Original file line number Diff line number Diff line change 3
3
// license that can be found in the LICENSE file.
4
4
package com .deepl .api ;
5
5
6
- import static java .lang .Math .max ;
7
- import static java .lang .Math .min ;
8
-
9
6
import com .deepl .api .http .HttpResponse ;
10
7
import com .deepl .api .http .HttpResponseStream ;
11
8
import com .deepl .api .parsing .Parser ;
@@ -1026,11 +1023,7 @@ private void checkResponse(
1026
1023
}
1027
1024
1028
1025
private int calculateDocumentWaitTimeMillis (Long secondsRemaining ) {
1029
- if (secondsRemaining != null ) {
1030
- double secs = ((double ) secondsRemaining ) / 2.0 + 1.0 ;
1031
- secs = max (1.0 , min (secs , 60.0 ));
1032
- return (int ) (secs * 1000 );
1033
- }
1034
- return 1000 ;
1026
+ // secondsRemaining is currently unreliable, so just poll equidistantly
1027
+ return 5000 ;
1035
1028
}
1036
1029
}
You can’t perform that action at this time.
0 commit comments