adulau / Forban

Forban is a p2p application for link-local and local area networks. Forban works independently from the Internet and uses only the local area capabilities to announce, discover, search or share files. Forban relies on HTTP and it is "opportunistic".
http://www.foo.be/forban/
134 stars 24 forks source link

Negative "Last seen" time #9

Closed MaStr closed 12 years ago

MaStr commented 12 years ago

Hi, I have a PirateBox special, again :) The most devices doesn't keep their date-time with power-off. So the Boxes start at a minimum Time and counts up. If you restart the Box with Forban, you always get a list with negative values... and these Boxes are already offline:

Access  Name    Last seen   Size    How many files are missing from yourself?   
v4      grml    -7787.0 secs ago    11.97KB Missing no files from this loot [missing?] [browse] 
v4      anoia   -1076.0 secs ago    11.97KB Missing no files from this loot [missing?] [browse] 
v4      piratebox.lan   -7740.0 secs ago    564.46MB    Missing 1 files from this loot [browse] yourself
  1. How can I do a houskeeping on these entries?
  2. Is it possible to "ignore" Boxes with negative values?

Thank you :)

Matthias

MaStr commented 12 years ago

Housekeeping can be done via Batch-file, too.

I found my own ID in /var/fid ls on /var/loot remove Every folder <> my id

Did I missed something?

adulau commented 12 years ago

Sure. I could update the "cleanup" script part to remove all the loot entries including the "self" entry.

It's useful to have them in cache, especially when there are many large indexes between the Forban and a large set of Forban in the same local area network.

Regarding the negative time, if the OpenWRT boxes have no reference clock, this starts to be difficult to show the relative time of the announces. But as the OpenWRT/PirateBox/LibraryBox model seems to be "on restart we clean-up the mess" ;-), I could just do the update clean-up part.

Let me know if this is fine for you.

adulau commented 12 years ago

Looking into it, I'll add another function "lootcleanup" that can be reused at reboot for low-end hardware.

The only important thing is to keep is the "fid" (the GUID of the Forban) at each reboot.

MaStr commented 12 years ago

I would do cleanup the loot without the "self" entry. Why? Rebuild should run faster, shouldn't it?

You say, "take care of the fid". In case of upgrading the forban sources, the guid will be lost (I exchange the image-file completly). Do you think it is useful the keep the file while upgrading?

Matthias

adulau commented 12 years ago

Hi Matthias,

The loot "self" entry is done the forban_discover process so this doesn't impact the rebuild process done by forban_announce.

So this shouldn't impact the bootstrap of the Forban. I'll prefer to clean-up especially if the time clock is different per OpenWRT.

Keeping the fid is very useful if you have some long-standing Forban (in opportunistic mode) in the local area network (assuming mixed devices type).

Loosing the GUID during the upgrade is fine to me, I assume that you don't upgrade at each reboot ;-)

I'll add the lootcleanup.

See ya,