Watch more file events for CRL files
This commit is contained in:
parent
01c2da507f
commit
ffffe3c329
1 changed files with 8 additions and 1 deletions
|
@ -122,14 +122,21 @@ func (d *CRLCertDB) LookupResponseTemplate(number *big.Int) *ocsp.Response {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d *CRLCertDB) watchCRLFile(watcher *fsnotify.Watcher) {
|
func (d *CRLCertDB) watchCRLFile(watcher *fsnotify.Watcher) {
|
||||||
|
const eventMask = fsnotify.Create | fsnotify.Write | fsnotify.Chmod | fsnotify.Rename
|
||||||
|
|
||||||
for {
|
for {
|
||||||
select {
|
select {
|
||||||
case event, ok := <-watcher.Events:
|
case event, ok := <-watcher.Events:
|
||||||
if !ok {
|
if !ok {
|
||||||
|
logrus.Trace("could not read file watcher event")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if event.Op&fsnotify.Write == fsnotify.Write {
|
logrus.Tracef("received event %s", event)
|
||||||
|
|
||||||
|
if event.Op&eventMask >= 1 {
|
||||||
|
logrus.Tracef("event matches event mask %s", event)
|
||||||
|
|
||||||
if event.Name == d.crlPath {
|
if event.Name == d.crlPath {
|
||||||
logrus.Infof("modified: %s", event.Name)
|
logrus.Infof("modified: %s", event.Name)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue