Git Product home page Git Product logo

watcher's People

Contributors

codacy-badger avatar imgbotapp avatar mend-bolt-for-github[bot] avatar racherb avatar rustyjam avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

watcher's Issues

close func not work for alteration when the file not exist

Describe the bug
close func not work for alteration when the file not exist

To Reproduce
Steps to reproduce the behavior:

  1. Execute fw.alteration({'/tmp/fileA.tx'})
  2. Take note for wid returned
  3. Wait for 60s
  4. Verify end status with monit: mon.info(wid)
  5. See error: ans: waiting

Expected behavior
A clear and concise description of what you expected to happen.

Monit's nomatch always returns the additional number of elements that are search patterns.

Bug
Monit's nomatch always returns the additional number of elements that are search patterns.

To Reproduce
Steps to reproduce the behavior:

  1. Here the watcher search has two elements that are file patterns.
fw=require('watcher').file
fw.creation({'/etc/*', '/opt/watcher/obs/host/tmp/*'})
  1. Take note of the value of the returned wid and wait for it to finish. The default MAXWAIT is 1 minute maximum wait time. Por example:1619642057921589

  2. Determine the number of nomatch elements for the value noted above.

mon=require('watcher').monit
mon.match(1619642057921589)
tarantool> mon.nomatch(1619642057921589)
---
- - [1619642057921589, '/etc/*', 1619642057922038559, false, '_', 0]
  - [1619642057921589, '/opt/watcher/obs/host/tmp/*', 1619642057922473550, false,
    '_', 0]
...
  1. As can be seen, the value of nomatch corresponds to the number of initial search patterns.

Expected behavior
The watcher for search patterns, when it has worked, should exclude the patterns.

LuajitError: builtin/fio.lua:544: pathname is absent

Describe the bug
File watcher fails when passing the file sort parameters for date 'MA' or 'MD' with the following error message:
main/119/file-watcher-bulk-d utils.c:1014 E> LuajitError: builtin/fio.lua:544: pathname is absent

To Reproduce
Steps to reproduce the behavior:

  1. Execute the following shell script:
#!/usr/bin/env tarantool

local file_watcher=require('watcher').file
local fiber=require('fiber')

local function remove_file(file, waitfor)
    fiber.sleep(waitfor)
    os.remove(file)
end

os.execute('touch /tmp/f_G.txt')
os.execute('touch /tmp/f_H.txt')
os.execute('touch /tmp/f_I.txt')
os.execute('touch /tmp/f_J.txt')
os.execute('touch /tmp/f_K.txt')
os.execute('touch /tmp/f_L.txt')

local n_match = 2

fiber.create(remove_file, '/tmp/f_G.txt', 2)
fiber.create(remove_file, '/tmp/f_L.txt', 2)
fiber.create(remove_file, '/tmp/f_K.txt', 2)

local ini = os.time()

local SORT_BY = {
    NO_SORT = 'NS',
    ALPHA_ASC = 'AA',
    ALPHA_DSC = 'AD',
    MTIME_ASC = 'MA',
    MTIME_DSC = 'MD'
}

local sort_by = SORT_BY.MTIME_ASC

--This fail for SORT_BY.MTIME_ASC and SORT_BY.MTIME_DSC
res = file_watcher.deletion({'/tmp/f_*'}, 5, 0.5, {'MA', 3, 2})

print('Elapsed time: ' .. os.difftime(os.time() - ini) .. 's')

print(res.wid)
print(res.ans)

os.exit()
  1. See error

Expected behavior
The system should work equally well for the different types of file sorting: NO_SORT = 'NS', ALPHA_ASC = 'AA', ALPHA_DSC = 'AD', MTIME_ASC = 'MA' and MTIME_DSC = 'MD'.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.