Use init-time creation only of StorageCounter to use less inotify instances

This commit is contained in:
Kevin Froman 2020-08-21 09:56:49 -05:00
parent bbc9646a25
commit cd0b69b03f
4 changed files with 7 additions and 5 deletions

View file

@ -36,6 +36,7 @@ from onionrtypes import UserIDSecretKey
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
"""
storage_counter = storagecounter.StorageCounter()
def _check_upload_queue():
@ -73,8 +74,6 @@ def insert_block(data: Union[str, bytes], header: str = 'txt',
our_private_key = crypto.priv_key
our_pub_key = crypto.pub_key
storage_counter = storagecounter.StorageCounter()
allocationReachedMessage = 'Cannot insert block, disk allocation reached.'
if storage_counter.is_full():
logger.error(allocationReachedMessage)