Refresh token 5 minutes before the expiry (#1253)
* Refresh token 5 minutes before the expiry
This commit is contained in:
Родитель
713474f158
Коммит
0f20ace345
|
@ -8,6 +8,7 @@
|
|||
|
||||
**Optimizations**
|
||||
- Optimized file-cache to skip download when O_TRUNC flag is provided in open call.
|
||||
- Refresh token 5 minutes before the expiry instead of last 10 seconds.
|
||||
|
||||
## 2.1.0 (2023-08-31)
|
||||
**Features**
|
||||
|
|
|
@ -209,7 +209,7 @@ func (azmsi *azAuthBlobMSI) getCredential() interface{} {
|
|||
log.Debug("azAuthBlobMSI::getCredential : MSI Token retrieved %s (%d)", newToken.AccessToken, newToken.Expires())
|
||||
|
||||
// Get the next token slightly before the current one expires
|
||||
return time.Until(newToken.Expires()) - 10*time.Second
|
||||
return time.Until(newToken.Expires()) - 5*time.Minute
|
||||
})
|
||||
} else {
|
||||
log.Info("azAuthBlobMSI::getCredential : MSI Token retrieved %s (%d)", token.AccessToken, token.Expires())
|
||||
|
@ -226,7 +226,7 @@ func (azmsi *azAuthBlobMSI) getCredential() interface{} {
|
|||
log.Debug("azAuthBlobMSI::getCredential : MSI Token retrieved %s (%d)", newToken.AccessToken, newToken.Expires())
|
||||
|
||||
// Get the next token slightly before the current one expires
|
||||
return time.Until(newToken.Expires()) - 10*time.Second
|
||||
return time.Until(newToken.Expires()) - 5*time.Minute
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -288,7 +288,7 @@ func (azmsi *azAuthBfsMSI) getCredential() interface{} {
|
|||
log.Debug("azAuthBfsMSI::getCredential : MSI Token retrieved %s (%d)", newToken.AccessToken, newToken.Expires())
|
||||
|
||||
// Get the next token slightly before the current one expires
|
||||
return time.Until(newToken.Expires()) - 10*time.Second
|
||||
return time.Until(newToken.Expires()) - 5*time.Minute
|
||||
})
|
||||
} else {
|
||||
log.Info("azAuthBfsMSI::getCredential : MSI Token retrieved %s (%d)", token.AccessToken, token.Expires())
|
||||
|
@ -305,7 +305,7 @@ func (azmsi *azAuthBfsMSI) getCredential() interface{} {
|
|||
log.Debug("azAuthBfsMSI::getCredential : MSI Token retrieved %s (%d)", newToken.AccessToken, newToken.Expires())
|
||||
|
||||
// Get the next token slightly before the current one expires
|
||||
return time.Until(newToken.Expires()) - 10*time.Second
|
||||
return time.Until(newToken.Expires()) - 5*time.Minute
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
@ -131,7 +131,7 @@ func (azspn *azAuthBlobSPN) getCredential() interface{} {
|
|||
log.Debug("azAuthBlobSPN::getCredential : SPN Token retrieved %s (%d)", spt.Token().AccessToken, spt.Token().Expires())
|
||||
|
||||
// Get the next token slightly before the current one expires
|
||||
return time.Until(spt.Token().Expires()) - 10*time.Second
|
||||
return time.Until(spt.Token().Expires()) - 5*time.Minute
|
||||
})
|
||||
|
||||
return tc
|
||||
|
@ -163,7 +163,7 @@ func (azspn *azAuthBfsSPN) getCredential() interface{} {
|
|||
log.Debug("azAuthBfsSPN::getCredential : SPN Token retrieved %s (%d)", spt.Token().AccessToken, spt.Token().Expires())
|
||||
|
||||
// Get the next token slightly before the current one expires
|
||||
return time.Until(spt.Token().Expires()) - 10*time.Second
|
||||
return time.Until(spt.Token().Expires()) - 5*time.Minute
|
||||
})
|
||||
|
||||
return tc
|
||||
|
|
|
@ -388,7 +388,7 @@ func (bc *BlockCache) ReadInBuffer(options internal.ReadInBufferOptions) (int, e
|
|||
return dataRead, nil
|
||||
}
|
||||
|
||||
// getBlock: From offset generate the Block index and get the Block corrosponding to it
|
||||
// getBlock: From offset generate the Block index and get the Block corresponding to it
|
||||
/* Base logic of getBlock:
|
||||
Check if the given block is already available or not
|
||||
if not
|
||||
|
|
|
@ -306,7 +306,7 @@ func (p *lruPolicy) clearCache() {
|
|||
|
||||
pUsage := getUsagePercentage(p.tmpPath, p.maxSizeMB)
|
||||
if pUsage < p.lowThreshold || cleanupCount >= 3 {
|
||||
log.Info("lruPolicy::ClearCache : Threshold stablized %f > %f", pUsage, p.lowThreshold)
|
||||
log.Info("lruPolicy::ClearCache : Threshold stabilized %f > %f", pUsage, p.lowThreshold)
|
||||
continueDeletion = false
|
||||
}
|
||||
}
|
||||
|
|
|
@ -40,7 +40,7 @@ import (
|
|||
"github.com/stretchr/testify/suite"
|
||||
)
|
||||
|
||||
// Test compoennts
|
||||
// Test components
|
||||
type ComponentA struct {
|
||||
BaseComponent
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@ int main()
|
|||
|
||||
printf("Reading before flush\n");
|
||||
r = fread(data, 1, 200, rfp);
|
||||
printf("Bytes read before flush (not expec) : %d\n", r);
|
||||
printf("Bytes read before flush (not exp) : %d\n", r);
|
||||
|
||||
printf("Flushing\n");
|
||||
fflush(wfp);
|
||||
|
|
Загрузка…
Ссылка в новой задаче