Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libvmod-file
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
uplex-varnish
libvmod-file
Commits
dd006dac
Commit
dd006dac
authored
Sep 22, 2019
by
Geoff Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add docs for .size(), .mtime() and .next_check().
parent
866f7d40
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
58 additions
and
10 deletions
+58
-10
README.rst
README.rst
+29
-5
vmod_file.vcc
src/vmod_file.vcc
+29
-5
No files found.
README.rst
View file @
dd006dac
...
...
@@ -309,9 +309,16 @@ Example::
BYTES xreader.size()
--------------------
Return the size of the file when it was most recently checked.
Return the size of the file as currently cached. Invokes VCL failure
if the most recent update check encountered an error.
XXX ...
Example::
# Use the cached synth body if non-empty, otherwise use the standard
# Varnish Guru Meditation.
if (synth_body.size() > 0B) {
synth_body.synth();
}
.. _xreader.mtime():
...
...
@@ -319,9 +326,18 @@ TIME xreader.mtime()
--------------------
Return the modification time of the file determined when it was mostly
recently checked.
recently checked. Invokes VCL failure if the most recent update check
encountered an error.
XXX ...
Example::
import std;
# Log a message if the file has not been updated within the last
# day.
if (now - rdr.mtime() > 1d) {
std.log("file last updated at " + rdr.mtime());
}
.. _xreader.next_check():
...
...
@@ -330,7 +346,15 @@ DURATION xreader.next_check()
Return the time remaining until the next check will be performed.
XXX ...
Example::
import vtc;
# If an update is pending within the next second, wait for it.
if (synth_body.next_check() < 1s) {
vtc.sleep(1s);
synth_body.synth();
}
.. _file.version():
...
...
src/vmod_file.vcc
View file @
dd006dac
...
...
@@ -280,22 +280,46 @@ Example::
$Method BYTES .size()
Return the size of the file when it was most recently checked.
Return the size of the file as currently cached. Invokes VCL failure
if the most recent update check encountered an error.
XXX ...
Example::
# Use the cached synth body if non-empty, otherwise use the standard
# Varnish Guru Meditation.
if (synth_body.size() > 0B) {
synth_body.synth();
}
$Method TIME .mtime()
Return the modification time of the file determined when it was mostly
recently checked.
recently checked. Invokes VCL failure if the most recent update check
encountered an error.
XXX ...
Example::
import std;
# Log a message if the file has not been updated within the last
# day.
if (now - rdr.mtime() > 1d) {
std.log("file last updated at " + rdr.mtime());
}
$Method DURATION .next_check()
Return the time remaining until the next check will be performed.
XXX ...
Example::
import vtc;
# If an update is pending within the next second, wait for it.
if (synth_body.next_check() < 1s) {
vtc.sleep(1s);
synth_body.synth();
}
$Function STRING version()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment