DATACOUCH-328 - Fix document expiry when using expressions
When using an expiry expression with TimeUnit.DAYS larger than 30 days the document expiry is not correctly set. Original pull request: #150.
This commit is contained in:
committed by
Subhashni Balakrishnan
parent
b687ff8217
commit
4908749bcd
@@ -109,7 +109,7 @@ public class BasicCouchbasePersistentEntity<T> extends BasicPersistentEntity<T,
|
||||
Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
|
||||
if (annotation.expiryUnit() == TimeUnit.DAYS) {
|
||||
//makes sure we won't lose resolution
|
||||
cal.add(Calendar.DAY_OF_MONTH, annotation.expiry());
|
||||
cal.add(Calendar.DAY_OF_MONTH, expiryValue);
|
||||
} else {
|
||||
//use the shift in seconds since resolution should be smaller
|
||||
cal.add(Calendar.SECOND, (int) secondsShift);
|
||||
|
||||
Reference in New Issue
Block a user